MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.11k stars 198 forks source link

[Feature] Get pip to install juliaup #274

Closed MilesCranmer closed 5 months ago

MilesCranmer commented 1 year ago

I’m thinking about how to make PySR even easier to set up and install. The conda side is already automatic which is great; I’m thinking about the pip side now. One idea I had is that, if a user doesn’t have a copy of Julia on their path, then installing PySR with pip could trigger an automatic install of juliaup, with a bunch of interactive prompts to ask the user if they want to, where they want to install, etc. Following this, it would automatically run pysr.install().

Maybe this could even be done on the PyJulia side of things… What do you think @mkitti?

mkitti commented 1 year ago

Sure. You might still want a prompt to ask the user to proceed.

You may want to consider https://github.com/johnnychen94/jill.py ... but juliaup is a pretty good solution going forward.

mkitti commented 1 year ago

Also see https://github.com/cjdoris/pyjuliaup

MilesCranmer commented 1 year ago

I've been thinking about doing a full switch to PythonCall.jl to simplify things like this, but it sounds like static Python installs might not be supported?

https://github.com/cjdoris/PythonCall.jl/issues/318#issuecomment-1573866457

From the logs you've sent, it's a statically linked build of Python which is unfortunately not supported by PythonCall (because it needs to dynamically link to libpython). Often this is the case for Python bundled in system package managers.

@cjdoris is this correct? I'm not sure I understand because I had thought all Python binaries installed by conda were static – but the existence of CondaPkg.jl seems to contradict this

cjdoris commented 1 year ago

Ok, well strictly all PythonCall needs is a shared libpython (i.e. libpython.so or libpython.dll) and the linkage of the python executable is not relevant. But I assume that if a shared libpython is available then python itself is dynamically linked. Perhaps not.

MilesCranmer commented 1 year ago

It looks like conda packages libpython3.so so even though it's a static python executable, the libpython is shared. If I understand this correctly. Are you able to install PythonCall.jl as a dependency of conda environments, and use the Python+Julia versions packaged by conda? If so, we should be good to go in terms of making a port of PySR.

MilesCranmer commented 5 months ago

Fixed by #535