遵循关于PyCall.jl自述的说明,在我的朱莉娅项目中使用PyCall (在它自己的环境中)时,我正在绑定使用python。
在终端中,我使用pipenv shell激活了python环境,然后定位了pipenv版本python的路径文件。PyCall已经添加到我的朱莉娅环境中的清单中。在源激活的终端中,我启动了朱莉娅,输入: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总是抛出这个错误。我如何可以覆盖或以其他方式围绕基本julia的conda要求工作?
我感觉到PyCall的Conda依赖导致了一些libpython问题,并且ENV["PYCALL_JL_RUNTIME_PYTHON"]调用没有正确覆盖libpython变量。
发布于 2020-01-27 22:41:42
根据文档,venv和virtualenv环境支持PyCall,但您使用的是pipenv。如果您想使用PYCALL_JL_RUNTIME_PYTHON变量,我建议您尝试使用任何一个受支持的替代方案。
如果要使用继续使用pipenv环境,则可能必须在startup.jl配置文件中指定PYTHON变量,如下所示:
ENV["PYTHON"] = "C:\\path\\to\\your\\pipenv\\python.exe"然后跑:
julia> using Pkg; Pkg.build("PyCall"); using PyCallhttps://stackoverflow.com/questions/59889778
复制相似问题