How to point Julia to a python executable

Hello, When trying to precompile PythonCall I received the following error

IOError: could not spawn `/Users/jerome/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/bin/python --version`: no such file or directory (ENOENT)
Stacktrace:
 [1] run
   @ ./process.jl:510 [inlined]
 [2] init_context()
   @ PythonCall.C ~/.julia/packages/PythonCall/L4cjh/src/C/context.jl:88
 [3] __init__()
   @ PythonCall.C ~/.julia/packages/PythonCall/L4cjh/src/C/C.jl:23
 [4] top-level scope
   @ stdin:6

I understand that Julia needs a python executable to function with pyplot() etc. Can you help me point Julia to one?
Thank you!

You can use ENV["JULIA_PYTHONCALL_EXE"], see Guide · PythonCall & JuliaCall.

I had to set these three variables (on Ubuntu):

 "JULIA_CONDAPKG_EXE" – point to pythonpath
 "JULIA_CONDAPKG_BACKEND"="Null" 
"PYTHON_JULIACALL_HANDLE_SIGNALS"="yes"

Can you give the full log from the precompilation? It’s very odd that Python is not available there, it should have been downloaded by default.

Also can you post the output of versioninfo()?

I asseconde that.

Bu default, PyrhonCall, when installed, download and install a “private to Julia” version of Pyrhon. No need to do anything unusual.
Only if you esplicitly specify , as suggested above, the Python path, it will use that path.

So, something went wrong in the installation of PythonCall (or of a package that requires it)…

The output of versioning() is:

Julia Version 1.11.4
Commit 8561cc3d68* (2025-03-10 11:36 UTC)
Build Info:
  Built by Homebrew (v1.11.4)

    Note: This is an unofficial build, please report bugs to the project
    responsible for this build and not to the Julia project unless you can
    reproduce the issue using official builds available at https://julialang.org/downloads

Platform Info:
  OS: macOS (x86_64-apple-darwin23.6.0)
  CPU: 12 × Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 6 default, 0 interactive, 3 GC (on 12 virtual cores)
Environment:
  JULIA_NUM_THREADS = 6

I followed the steps here and set my conda environment variable to current and then it compiled. But now, my environment variable is empty wrt Python again.


julia> ENV["JULIA_CONDAPKG_BACKEND"]
ERROR: KeyError: key "JULIA_CONDAPKG_BACKEND" not found
Stacktrace:
 [1] access_env
   @ ./env.jl:60 [inlined]
 [2] getindex(::Base.EnvDict, k::String)
   @ Base ./env.jl:164
 [3] top-level scope
   @ REPL[6]:1