MilesCranmer / PySR

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

[BUG]: Installation, Unsatisfiable requirements #362

Closed soerenab closed 1 year ago

soerenab commented 1 year ago

What happened?

Hi Miles, Thank you for making PySR available!

I am facing an error during installation, when calling python3 -m pysr install:

julia.core.JuliaError: Exception 'Unsatisfiable requirements detected for package DynamicExpressions [a40a106e]:
 DynamicExpressions [a40a106e] log:
 ├─possible versions are: 0.1.0-0.4.2 or uninstalled
 └─restricted to versions 0.8 by SymbolicRegression [8254be44] — no versions left
   └─SymbolicRegression [8254be44] log:
     ├─possible versions are: 0.18.0 or uninstalled
     └─SymbolicRegression [8254be44] is fixed to version 0.18.0' occurred while calling julia code:
Pkg.add([sr_spec, clustermanagers_spec], io=stderr)

I successfully installed PySR about two month ago following your instructions (same command as above). From the error message, the problem seems to be that PySR requires SymbolicRegression==0.18.0 which in turn requires DynamicExpressions==0.8 which for some reason does not seem to be available.

System information:

Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      "Rocky Linux release 8.7 (Green Obsidian)"

Version

I tried with '0.14.0' and '0.14.2'.

Operating System

Linux

Package Manager

pip

Interface

IPython Terminal

Relevant log output

python3 -m pysr install
[ Info: Julia version info
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      "Rocky Linux release 8.7 (Green Obsidian)"
  uname: Linux 4.18.0-425.3.1.el8.x86_64 #1 SMP Wed Nov 9 20:13:27 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz:
                 speed         user         nice          sys         idle          irq
       #1-48  3000 MHz   10791459 s       2468 s    6061712 s  361330180 s     455443 s
  Memory: 377.184139251709 GB (287429.1953125 MB free)
  Uptime: 793184.29 sec
  Load Avg:  2.04  1.77  1.84
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake-avx512)
  Threads: 1 on 48 virtual cores
Environment:
  JULIA_PROJECT = @pysr-0.14.2
  HOME = /home/haicu/soeren.becker
  TERM = xterm-256color
  PATH = /home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/bin:/home/haicu/soeren.becker/miniconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/haicu/soeren.becker/repos/julia-1.8.4/bin:/home/haicu/soeren.becker/.local/bin:/home/haicu/soeren.becker/bin
[ Info: Julia executable: /home/haicu/soeren.becker/repos/julia-1.8.4/bin/julia
[ Info: Trying to import PyCall...
┌ Warning: PyCall is already installed.  However, you may have trouble using
│ this Python executable because it is statically linked to libpython.
│
│ For more information, see:
│     https://pyjulia.readthedocs.io/en/latest/troubleshooting.html
│
│ Python executable:
│     /home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/bin/python3
│ Julia executable:
│     /home/haicu/soeren.becker/repos/julia-1.8.4/bin/julia
└ @ Main ~/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/julia/install.jl:90
/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/pysr/julia_helpers.py:195: UserWarning: Your system's Python library is static (e.g., conda), so precompilation will be turned off. For a dynamic library, try using `pyenv` and installing with `--enable-shared`: https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#building-with---enable-shared.
  warnings.warn(
┌ Warning: could not download https://pkg.julialang.org/registries
│   exception = Failed to connect to pkg.julialang.org port 443 after 15245 ms: Connection timed out while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry /cache/build/default-aws-shared0-3/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/Registry/Registry.jl:68
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
Traceback (most recent call last):
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/pysr/__main__.py", line 4, in <module>
    _cli(prog_name="pysr")
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/pysr/_cli/main.py", line 37, in _install
    install(julia_project, quiet, precompile)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/pysr/julia_helpers.py", line 96, in install
    _add_sr_to_julia_project(Main, io_arg)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/pysr/julia_helpers.py", line 259, in _add_sr_to_julia_project
    Main.eval(f"Pkg.add([sr_spec, clustermanagers_spec], {io_arg})")
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/julia/core.py", line 627, in eval
    ans = self._call(src)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/julia/core.py", line 555, in _call
    self.check_exception(src)
  File "/home/haicu/soeren.becker/miniconda3/envs/symbolicregression39/lib/python3.9/site-packages/julia/core.py", line 609, in check_exception
    raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
julia.core.JuliaError: Exception 'Unsatisfiable requirements detected for package DynamicExpressions [a40a106e]:
 DynamicExpressions [a40a106e] log:
 ├─possible versions are: 0.1.0-0.4.2 or uninstalled
 └─restricted to versions 0.9 by SymbolicRegression [8254be44] — no versions left
   └─SymbolicRegression [8254be44] log:
     ├─possible versions are: 0.19.1 or uninstalled
     └─SymbolicRegression [8254be44] is fixed to version 0.19.1' occurred while calling julia code:
Pkg.add([sr_spec, clustermanagers_spec], io=stderr)

Extra Info

No response

MilesCranmer commented 1 year ago

Thanks for the bug report. Could you see whether the solutions here are any help? https://github.com/MilesCranmer/PySR/issues/27 thanks

MilesCranmer commented 1 year ago

Basically it might be your package server for Julia is not updating. Because the latest version of DynamicExpressions.jl is https://github.com/SymbolicML/DynamicExpressions.jl/releases/tag/v0.10.1 whereas your Julia thinks it is only 0.4.2 for some reason.

(It could also be if you happen to be using a local version of DynamicExpressions.jl?)

soerenab commented 1 year ago

Indeed, this was the problem and the steps you linked solved it. Thanks a lot!

MilesCranmer commented 1 year ago

Awesome!