-
Notifications
You must be signed in to change notification settings - Fork 216
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
[BUG] Can't re-build PyCall.jl after upgrading Python #222
Comments
This is probably due to a stale deps.jl file. We should probably move to a Preferences.jl mechanism for this or again take inspiration from PythonCall.jl. |
You should be able to locate the deps file via this code.
|
Maybe this could be checked at |
This would be much easier to handle via Preferences.jl. We should use that. |
Will 'PySr' run with Julia 1.9?
|
Yes, it works for me. Just follow the instructions here: #257 |
Works for me now. Thanks! |
Cool. Yes I would really like to have that bug automatically solved by PySR, but I'm not sure how to do it so far. |
Self-repair added by #363, so closing this. (Will re-open if any other issues) |
Just documenting this in case others encounter it.
This is a weird bug often reported on PyCall.jl where PyCall will somehow cache the location of your old Python binary, and re-building will fail.
I downgraded my Python version from 3.11 to 3.10, and tried to do
python -c 'import pysr; pysr.install()'
. This gave me the error:If I open up Julia, install PyCall.jl into any environment, and write:
it gives me the old location of the Python binary! The only one in that folder is now
python3.10
- thepython3.11
was removed. This is even true if I uninstall and re-install PyCall.jl. It will somehow remember the old location, and re-building it will fail. Maybe it expectsPyCall.python
to be unchanged between Python versions?The way I ended up fixing this is to run (inside Julia)
this successfully re-builds PyCall.jl. But I think ideally this shouldn't be necessary, to lower friction for users. To do this, I think PyJulia should check what Python binary was used to launch it, and, if necessary, reset
ENV
and rebuild.FYI @mkitti @stevengj
The text was updated successfully, but these errors were encountered: