无法在FreeBSD 13上安装带有Julia 1.6.3版本的PyCall.jsl



我正在尝试安装PyCall.jsl,但遇到了一个错误。我已经在FreeBSD 13中安装了Python 3.10。我还在操作系统上单独创建了一个python 3.10虚拟环境,我打算从中调用python包。错误如下。

(dataViz) pkg> add PyCall
Resolving package versions...
Installed VersionParsing ─ v1.2.1
Installed Conda ────────── v1.5.2
Installed MacroTools ───── v0.5.9
Installed JSON ─────────── v0.21.2
Installed PyCall ───────── v1.92.5
Updating `/usr/home/schroter/dataViz/Project.toml`
[438e738f] + PyCall v1.92.5
Updating `/usr/home/schroter/dataViz/Manifest.toml`
[8f4d0f93] + Conda v1.5.2
[682c06a0] + JSON v0.21.2
[1914dd2f] + MacroTools v0.5.9
[438e738f] + PyCall v1.92.5
[81def892] + VersionParsing v1.2.1
Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/299304989a5e6473d985212c28928899c74e9421/build.log`
Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/4ba3651d33ef76e24fef6a598b63ffd1c5e1cd17/build.log`
ERROR: Error building `PyCall`:
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
ERROR: LoadError: Couldn't find libpython; check your PYTHON environment variable.
The python executable we tried was python3 (= version 3.10).
Re-building with
ENV["PYCALL_DEBUG_BUILD"] = "yes"
may provide extra information for why it failed.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] find_libpython(python::String; _dlopen::typeof(Base.Libc.Libdl.dlopen))
@ Main ~/.julia/packages/PyCall/3fwVL/deps/buildutils.jl:72
[3] find_libpython(python::String)
@ Main ~/.julia/packages/PyCall/3fwVL/deps/buildutils.jl:41
[4] top-level scope
@ ~/.julia/packages/PyCall/3fwVL/deps/build.jl:82
[5] include(fname::String)
@ Base.MainInclude ./client.jl:444
[6] top-level scope
@ none:5
in expression starting at /home/schroter/.julia/packages/PyCall/3fwVL/deps/build.jl:43

Julia中安装的模块如下:

(dataViz) pkg> status
Status `/usr/home/schroter/.jlmain/dataViz/Project.toml`
[336ed68f] CSV v0.9.10
[54eefc05] Cascadia v1.0.1
[a93c6f00] DataFrames v1.2.2
[708ec375] Gumbo v0.8.0
[cd3eb016] HTTP v0.9.16
[c3e4b0f8] Pluto v0.17.1
[05625dda] WebDriver v0.1.2

编辑:我的系统范围python位于:/usr/local/bin/python3我的python虚拟环境位于:~/.pymain/dataViz/bin/activate.csh

有人能在这件事上帮我吗?

谢谢&致以最诚挚的问候

施罗德

您没有提到设置PYTHON环境变量,因此这可能是问题的原因:

ENV["PYTHON"]="/usr/local/bin/python3"
using Pkg
Pkg.build("PyCall")

为了获得最佳效果,请尝试使用Miniconda/Anaconda Python,最好让Julia安装它(尽管我不知道在FreeBSD上安装Miniconda有多容易或有多困难,但在任何Linux上,它通常"只起作用"(:

ENV["PYTHON"]=""
using Pkg
Pkg.build("PyCall")

如果你想使用一些Miniconda:

ENV["PYTHON"]="/home/user/miniconda/bin/python"
using Pkg
Pkg.build("PyCall")

让我知道这是否有帮助(我没有FreeBSD安装来测试(

相关内容

  • 没有找到相关文章

最新更新