JuliaPy / PyCall.jl

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

How to disable the conda when building PyCall? #989

Closed GTrunSec closed 2 years ago

GTrunSec commented 2 years ago

As a julia's Nix user, conda is a drag for me. Suppose that we have passed the python related Env, is there a convenient parameter to disable or detect conda processing>

Note: It works in a normal environment, but failed in the sandbox of the nix-build

const python = "/nix/store/nb91g6cfa8sd6z1z9kh94ksnd806ghkk-python3-3.9.11-env/bin/python3.9"
const libpython = "/nix/store/kwp97hvzh4dff613a4vhpbl6yblavshb-python3-3.9.11/lib/libpython3.9.so.1.0"
const pyprogramname = "/nix/store/nb91g6cfa8sd6z1z9kh94ksnd806ghkk-python3-3.9.11-env/bin/python3.9"
const pyversion_build = v"3.9.11"
const PYTHONHOME = "/nix/store/kwp97hvzh4dff613a4vhpbl6yblavshb-python3-3.9.11:/nix/store/kwp97hvzh4dff613a4vhp
bl6yblavshb-python3-3.9.11"

"True if we are using the Python distribution in the Conda package."
const conda = false

image

stevengj commented 2 years ago

Just because the Conda.jl package is installed doesn't mean that it actually installs a conda python distro.

In fact, by default on Unix platforms, PyCall uses the system python3, so if this is in your PATH you should have to do nothing. Otherwise, you can set ENV["PYTHON"] when building PyCall for the first time and it should use that, and will never install its own Python distro.

(The Conda.jl package by itself is an extremely lightweight dependency, if it's not being used to install a Python distro.)