Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Running PySR with Julia in Windows 10 (Anaconda Environment) #586

Closed
MilesCranmer opened this issue Mar 26, 2024 Discussed in #585 · 0 comments · Fixed by #587
Closed

Error Running PySR with Julia in Windows 10 (Anaconda Environment) #586

MilesCranmer opened this issue Mar 26, 2024 Discussed in #585 · 0 comments · Fixed by #587

Comments

@MilesCranmer
Copy link
Owner

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" and os.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 the Pkg.activate command, ensuring that all package operations were localized to this environment. After activating the environment, I executed Pkg.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 used Pkg.add() to explicitly add PythonCall, SymbolicRegression and Serialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant