You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After setting up a local Python version using pyenv, creating a virtual environment, and setting up PythonCall to use that venv instead of Conda, PythonCall can't be loaded:
julia> using PythonCall
┌ Warning: Python library "/Users/rdoake/.pyenv/versions/3.9.13/lib/python3.9/config-3.9-darwin/libpython3.9.a" could not be opened.
└ @ PythonCall.C ~/.julia/packages/PythonCall/1f5yE/src/cpython/context.jl:118
┌ Warning: Python library "/Users/rdoake/.pyenv/versions/3.9.13/lib/libpython3.9.a" could not be opened.
└ @ PythonCall.C ~/.julia/packages/PythonCall/1f5yE/src/cpython/context.jl:118
ERROR: InitError: ArgumentError: NULL library handle
The files referenced in the error message do exist.
Steps to reproduce
Create a directory & shell into it
pyenv local x.x # I used 3.9 to disambiguate from my default system Python, which is 3.10
create a venv at .venv using the tool of your choice (I tested with Poetry and venv)
launch Julia
] activate .
> ENV["JULIA_CONDAPKG_BACKEND"]="Null" # don't use Conda
> ENV["JULIA_PYTHONCALL_EXE"]=".venv/bin/python3" # point PythonCall to the venv python
] add PythonCall
> using PythonCall
My system
MacOS 13.4
Julia 1.9.0
PythonCall 0.9.13
Additional context
If I instead use poetry to specify a Python version for the virtual environment, and then do the above steps without using pyenv, then PythonCall works as expected.
The text was updated successfully, but these errors were encountered:
How did you install the version of Python you are trying to use? From the logs you've sent, it's a statically linked build of Python which is unfortunately not supported by PythonCall (because it needs to dynamically link to libpython). Often this is the case for Python bundled in system package managers.
Just realized I forgot to circle back to this -- that workaround does enable PythonCall.jl to work with a pyenv-installed Python version. I can keep doing that for the time being. Thanks!
Affects: PythonCall
Describe the bug
After setting up a local Python version using
pyenv
, creating a virtual environment, and setting up PythonCall to use that venv instead of Conda, PythonCall can't be loaded:The files referenced in the error message do exist.
Steps to reproduce
pyenv local x.x
# I used 3.9 to disambiguate from my default system Python, which is 3.10.venv
using the tool of your choice (I tested with Poetry and venv)] activate .
> ENV["JULIA_CONDAPKG_BACKEND"]="Null"
# don't use Conda> ENV["JULIA_PYTHONCALL_EXE"]=".venv/bin/python3"
# point PythonCall to the venv python] add PythonCall
> using PythonCall
My system
Additional context
If I instead use
poetry
to specify a Python version for the virtual environment, and then do the above steps without usingpyenv
, then PythonCall works as expected.The text was updated successfully, but these errors were encountered: