Skip to content

[BUG] Errors when building PyCall.jl #257

@MilesCranmer

Description

@MilesCranmer

tldr, delete the folders:

  • ~/.julia/packages/PyCall
  • ~/.julia/prefs/PyCall
  • ~/.julia/environments/pysr-{your-pysr-version}

and re-run python -m pysr install.


I am documenting this error because it has shown up a lot for people, and I want to document the solution.

The error is basically that after upgrading Python or Julia or both, and running PySR or re-installing PySR, you get the following error:

[ Info: Trying to import PyCall...
┌ Info: PyCall is already installed but not compatible with this Python
└ executable. Re-building PyCall...
[ Info: Run `Pkg.build(“PyCall”; verbose=true)`
ERROR: LoadError: The following package names could not be resolved:
 * PyCall (not found in project or manifest)

The solution to this is to delete your ~/.julia/packages/PyCall folder. Then, simply re-run python -m pysr install.

If this gives you further errors in building, you should also delete ~/.julia/prefs/PyCall, and re-run the install step. For further issues, you could delete ~/.julia/environments folder (or more specifically, the folders ~/.julia/environments/pysr-{version} and ~/.julia/environments/{julia_version}, if you want to keep your other environments).


This should fix the problem. This issue is basically that the old installed version of PyCall.jl is attached to a specific combination of Julia and Python. And, for whatever reason, re-running julia.install() doesn't update the built version of PyCall.jl.

This is a temporary manual solution. In the future PySR should handle this automatically.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions