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

Self-repairing incremental installs #363

Merged
merged 13 commits into from
Jul 4, 2023
Merged

Conversation

MilesCranmer
Copy link
Owner

@MilesCranmer MilesCranmer commented Jul 2, 2023

@mkitti I wonder if there is some way to do this automatically #257

TODO:

  • Figure out some way we can unit-test this.

@MilesCranmer
Copy link
Owner Author

Could also do this automatically with

subprocess.call(
    ["julia", "-e", 'rm(joinpath(first(DEPOT_PATH), "packages", "PyCall"), recursive=true)']
)

followed by re-trying julia.install. But I'm not sure if that is potentially dangerous or not. Wdyt @mkitti?

@mkitti
Copy link
Contributor

mkitti commented Jul 2, 2023

Umm, what's the primary issue. Is this new to Julia 1.9?

@MilesCranmer
Copy link
Owner Author

MilesCranmer commented Jul 2, 2023

This issue has been around for a while. It seems to be related to when you update your Python or Julia version, and try to re-install PyJulia, some install preferences stored in PyCall are violated.

@mkitti
Copy link
Contributor

mkitti commented Jul 2, 2023

This an environment issue:

ERROR: LoadError: The following package names could not be resolved: * PyCall (not found in project or manifest)

It is missing the UUID.

@MilesCranmer MilesCranmer changed the title Better help message for PyCall errors Get incremental installs to automatically work Jul 2, 2023
@MilesCranmer
Copy link
Owner Author

Cool!
Screenshot 2023-07-02 at 8 09 36 PM

Automatically patches that PyCall error 🥳

@MilesCranmer MilesCranmer merged commit 2c4d7e9 into master Jul 4, 2023
@xukai92
Copy link

xukai92 commented Jul 4, 2023

Hi Cranmer, I came from the JuliaPy/PyCall.jl#945 (I was looking into a similar issue a while back).
Just wonder if you have checked https://cjdoris.github.io/PythonCall.jl/stable/juliacall/, which is an alternative to PyJulia that seems to have better Python/Julia environment/version support.

Btw, really like your works on neural-symbolic methods for physics.
I have been following them and also did something related :)

@MilesCranmer
Copy link
Owner Author

MilesCranmer commented Jul 4, 2023

Thanks and thanks for sending your exciting paper! Very cool stuff.

Yes I'm indeed interested in potentially switching to juliacall. From what I've seen the installation process is much nicer, and so it would be great to have it as the PySR -> Julia interface. Just need someone to try 🙏 🙏 . The API is pretty similar so it shouldn't be too bad to switch (basically just jl.eval -> jl.seval; and then removing julia_helpers.py). The only downsides are that (1) it's fairly new whereas PyJulia has been around for a while and is "battle-tested", and (2) it doesn't sound like it can eliminate the precompilation issue we've been fighting for a while with static python installations (like conda). I'm not sure if (1) is an issue in practice though because juliacall is more Julia-heavy (rather than the Python-heavy PyJulia), so it's is probably safer to use longterm and has other advantages.

@MilesCranmer MilesCranmer changed the title Get incremental installs to automatically work Self-repairing incremental installs Jul 4, 2023
@MilesCranmer MilesCranmer deleted the pycall-install-help branch July 4, 2023 16:43
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 this pull request may close these issues.

3 participants