JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.46k stars 187 forks source link

Not able to use custom python environment #976

Open VolodyaCO opened 2 years ago

VolodyaCO commented 2 years ago

Hello, I'm on a mac m1 and have installed julia with the x86_64 arch. I also have a working python environment using the same arch. I tried building PyCall as mentioned in the readme to use a custom python environment where I have some libraries installed. However, I get an error. Here's the building procedure and attempt to use Pycall:

julia> ENV["PYTHON"] = "/Users/vladimirvargas/.local/share/virtualenvs/physics-jfSzH1Jb/bin/python"
"/Users/vladimirvargas/.local/share/virtualenvs/physics-jfSzH1Jb/bin/python"

julia> using Pkg; Pkg.build("PyCall")
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/6cdc8832ba11c7695f494c9d9a1c31e90959ce0f/build.log`
    Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/71fd4022ecd0c6d20180e23ff1b3e05a143959c2/build.log`

julia> using PyCall

julia> nk = pyimport("netket")
Assertion failed: (findOption(Name) == Values.size() && "Option already exists!"), function addLiteralOption, file /Users/ci/miniconda3/conda-bld/llvmdev_1601977477900/work/include/llvm/Support/CommandLine.h, line 853.

signal (6): Abort trap: 6
in expression starting at REPL[4]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 3683833 (Pool: 3681426; Big: 2407); GC: 4
[1]    25372 abort      julia

From the assertion message it seems that somehow PyCall is looking into some miniconda stuff. I don't know why this is the case since my python environment has nothing to do with conda: it is a pipenv environment.