按照 PyCall.jl 自述文件上的说明,在我的 julia 项目(在它自己的环境中)使用 PyCall 时,我打算使用 pipenv python。
在终端中,我使用 激活了 python 环境pipenv shell
,然后找到了 python 的 pipenv 版本的路径文件。PyCall 已经添加到我的 julia 环境中的清单中。在源代码激活的终端中,我启动了 Julia 并输入:ENV["PYCALL_JL_RUNTIME_PYTHON"] = pipenv python environment
然后继续运行Pkg.build("PyCall")
,它安装了 conda。导入 PyCall 时 - using PyCall
- 我收到以下错误。
ERROR: InitError: Incompatible `libpython` detected.
`libpython` for C:\Users\me\.virtualenvs\iap\Scripts\python.exe is:
C:\Users\me\.virtualenvs\iap\Scripts\python37.dll
`libpython` for C:\Users\me\.julia\conda\3\python.exe is:
C:\Users\me\.julia\conda\3\python36.dll
PyCall.jl only supports loading Python environment using the same `libpython`
我试过重新安装 PyCall,但是 python 环境 libpython 总是抛出这个错误。如何覆盖或以其他方式解决 base julia 的 conda 要求?
我感觉 PyCall 的 Conda 依赖引起了一些libpython
问题,并且ENV["PYCALL_JL_RUNTIME_PYTHON"]
调用没有正确覆盖 libpython 变量。