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!
eldee
May 27, 2025, 3:37pm
2
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
Ok, the error persists unfortunately. When wanting to invoke PythonCall
I am getting this error message.
using PythonCall
CondaPkg Initialising pixi
│ /Users/jerome/.julia/artifacts/cc02fad3b04cfb688ba4e3d60648ad8c3afe3a2d/bin/pixi
│ init
│ --format pixi
└ /Users/jerome/.julia/environments/v1.11/.CondaPkg
✔ Created /Users/jerome/.julia/environments/v1.11/.CondaPkg/pixi.toml
CondaPkg Wrote /Users/jerome/.julia/environments/v1.11/.CondaPkg/pixi.toml
│ [dependencies]
│
│ [project]
│ name = ".CondaPkg"
│ platforms = ["osx-64"]
│ channels = ["conda-forge"]
│ channel-priority = "strict"
└ description = "automatically generated by CondaPkg.jl"
CondaPkg Installing packages
│ /Users/jerome/.julia/artifacts/cc02fad3b04cfb688ba4e3d60648ad8c3afe3a2d/bin/pixi
│ install
└ --manifest-path /Users/jerome/.julia/environments/v1.11/.CondaPkg/pixi.toml
✔ The default environment has been installed.
ERROR: InitError: Python executable "/Users/jerome/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/bin/python" is not executable.
Stacktrace:
[1] init_context()
@ PythonCall.C ~/.julia/packages/PythonCall/L4cjh/src/C/context.jl:90
[2] __init__()
@ PythonCall.C ~/.julia/packages/PythonCall/L4cjh/src/C/C.jl:23
during initialization of module C
caused by: 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
Aha ok, well since the [dependencies]
section is empty, the python
dependency from PythonCall is not being found for some reason.
I suggest you add some print statements inside this function to figure out why it isn’t finding the CondaPkg.toml
file for PythonCall: CondaPkg.jl/src/resolve.jl at c1df0aa999b52460757a95225f5482f1a7eb31a0 · JuliaPy/CondaPkg.jl · GitHub
Also what is Pkg.status()
?
Please see here for Pkg.status()
Status `~/.julia/environments/v1.11/Project.toml`
⌃ [cbdf2221] AlgebraOfGraphics v0.10.4
[6e4b80f9] BenchmarkTools v1.6.0
[336ed68f] CSV v0.10.15
⌃ [13f3f980] CairoMakie v0.13.4
[324d7699] CategoricalArrays v0.10.8
[35d6a980] ColorSchemes v3.29.0
⌅ [5ae59095] Colors v0.12.11
⌃ [861a8166] Combinatorics v1.0.2
[992eb4ea] CondaPkg v0.2.29
[60f91f6f] CovarianceMatrices v0.22.0
[a93c6f00] DataFrames v1.7.0
⌃ [31c24e10] Distributions v0.25.117
[8f03c58b] Effects v1.4.0
⌃ [9d5cd8c9] FixedEffectModels v1.11.0
⌅ [f6369f11] ForwardDiff v0.10.38
[38e38edf] GLM v1.9.0
[1ecd5474] GraphMakie v0.5.14
[a2cc645c] GraphPlot v0.6.1
⌃ [bd48cda9] GraphRecipes v0.5.13
⌃ [86223c79] Graphs v1.12.0
⌃ [09f84164] HypothesisTests v0.11.3
[b964fa9f] LaTeXStrings v1.4.0
[d3d80556] LineSearches v7.3.0
[2ab3a3ac] LogExpFunctions v0.3.29
⌃ [d41bc354] NLSolversBase v7.8.3
[2774e3e8] NLsolve v4.5.1
[86f7a689] NamedArrays v0.10.3
⌃ [429524aa] Optim v1.11.0
[8314cec4] PGFPlotsX v1.6.2
[f8e8dcbf] PanelDataTools v0.3.0
⌃ [91a5bcdd] Plots v1.40.9
[6099a3de] PythonCall v0.9.25
[274fc56d] PythonPlot v1.0.6
[ce6b1742] RDatasets v0.7.7
[1277b4bf] ShiftedArrays v2.0.0
[47aef6b3] SimpleWeightedGraphs v1.5.0
[10745b16] Statistics v1.11.1
[f3b207a7] StatsPlots v0.15.7
[22787eb5] Term v2.0.7
[ebf5ac4f] TexTables v0.3.0
[9e3dc215] TimeSeries v0.24.2
[37e2e46d] LinearAlgebra v1.11.0
[2f01184e] SparseArrays v1.11.0
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`