Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong python (from wrong anaconda environment) when building PyCall with ENV["PYTHON"] #830

Closed
h-spiess opened this issue Sep 24, 2020 · 1 comment

Comments

@h-spiess
Copy link

h-spiess commented Sep 24, 2020

Hey,

I tried to use PyCall with the python i have installed in one of my anaconda environments. Unfortunately, it picks up the wrong anaconda environment and therefore the wrong python although building PyCall in verbose mode shows that the correct python and libpython is found.

julia> using Pkg

julia> ENV["PYTHON"] = "/home/spiess/anaconda3/envs/thesis/bin/python"
"/home/spiess/anaconda3/envs/thesis/bin/python"

julia> Pkg.build("PyCall", verbose=true)
   Building Conda ─→ `~/.julia/packages/Conda/3rPhK/deps/build.log`
   Building PyCall → `~/.julia/packages/PyCall/zqDXB/deps/build.log`
[ Info: PyCall is using /home/spiess/anaconda3/envs/thesis/bin/python (Python 3.7.7) at /home/spiess/anaconda3/envs/thesis/bin/python, libpython = /mnt/antares_raid/home/spiess/anaconda3/envs/thesis/lib/libpython3.7m.so.1.0
[ Info: /mnt/antares_raid/home/spiess/.julia/packages/PyCall/zqDXB/deps/deps.jl has not changed
[ Info: /home/spiess/.julia/prefs/PyCall has not changed

julia> using PyCall

julia> PyCall.libpython
"/mnt/antares_raid/home/spiess/anaconda3/envs/twoears_conda/lib/libpython3.6m.so.1.0"

I want it to use the environment "thesis" and not "twoears_conda".

I'm also wondering why

julia> PyCall.conda
false

as the python comes from an anaconda environment. Or does this property refer to the conda which is shipped with PyCall?

I'm using the newest version of julia (1.5.2) and PyCall (1.91.4).

I would really appreciate you help. Thanks in advance,
Heiner

@h-spiess
Copy link
Author

I solved it right after. I ran the build of PyCall in VSCode and after restarting julia everything worked as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant