Error Running PySR with Julia in Windows 10 (Anaconda Environment)
MilesCranmer opened this issue · 0 comments
Discussed in #585
Originally posted by sbalasbas3 March 27, 2024
Environment Details:
- Operating System: Windows-10-10.0.19045-SP0
- Python Version: 3.11.7
- Julia Version: (Unfortunately, I wasn't able to retrieve this detail due to the current issue, but it's supposed to be compatible with the latest pysr and juliacall versions.)
- juliacall Version: 0.9.19
- PySR Version: 0.18.0
My Problem:
Hello, I'm encountering an error when trying to use PySR. The initialization of PySR fails. Despite installing and setting up PySR and Julia, as well as ensuring that the juliacall package is up to date, I run into a CalledProcessError during the execution of Julia package management commands initiated by juliacall. I have no idea how to resolve this issue. This error occurs despite following the setup procedures for PySR and Julia within an Anaconda environment on Windows 10.
CalledProcessError: Command '['C:\\Users\\[USERNAME]\\AppData\\Local\\anaconda3\\envs\\sym_reg\\julia_env\\pyjuliapkg\\install\\bin\\julia.exe', '--project=C:\\Users\\[USERNAME]\\AppData\\Local\\anaconda3\\envs\\sym_reg\\julia_env', '--startup-file=no', '-e', 'import Pkg; Pkg.Registry.update(); Pkg.add([Pkg.PackageSpec(name="PythonCall", uuid="6099a3de-0909-46bc-b1f4-468b9a2dfc0d"), Pkg.PackageSpec(name="SymbolicRegression", uuid="8254be44-1295-4e6a-a16d-46603ac705cb", url=raw"https://github.com/MilesCranmer/SymbolicRegression.jl", rev=raw"v0.24.1"), Pkg.PackageSpec(name="Serialization", uuid="9e88b42a-f829-5b0c-bbe9-9e923198166b")]); Pkg.resolve(); Pkg.precompile()']' returned non-zero exit status 1.
Steps taken so far:
- Ensured juliacall is up to date by running
pip install --upgrade juliacall
, which confirmed version 0.9.19 is installed. - Attempted to manually specify the Julia executable's path using the JULIA_PYTHONCALL_EXE environment variable before importing PySR, without success. I wrote the code like this:
julia_path = "C:\\Users\\[USERNAME]\\AppData\\Local\\anaconda3\\envs\\sym_reg\\julia_env\\pyjuliapkg\\install\\bin\\julia.exe"
andos.environ["JULIA_PYTHONCALL_EXE"] = julia_path
- Activated Julia Environment: I activated the specific Julia project environment located at
C:\Users\[USERNAME]\AppData\Local\anaconda3\envs\sym_reg\julia_env
using thePkg.activate
command, ensuring that all package operations were localized to this environment. After activating the environment, I executedPkg.instantiate()
to install and update dependencies as defined in the environment's Project.toml and Manifest.toml files. This command updated the registry and added the PythonCall v0.9.19 and SymbolicRegression v0.24.1 packages among others. I also usedPkg.add()
to explicitly addPythonCall
,SymbolicRegression
andSerialization
.