MilesCranmer / PySR

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

[BUG]: Installation failed on Windows: failed to clone from SymbolicRegression.jl #445

Closed Nithouson closed 8 months ago

Nithouson commented 8 months ago

What happened?

I successfully installed and used an older version of PySR (0.14.x). As I want to upgrade to the latest version, I uninstalled the existing PySR (via pip) as well as Julia 1.6.1 (I also deleted the ~/.julia directory). Then I installed the latest Julia 1.6.3, and PySR 0.16.3 via pip. When I run the command python -m pysr install, the installation fails repeatedly, with the following Error message: julia.core.JuliaError: Exception 'failed to clone from https://github.com/MilesCranmer/SymbolicRegression.jl, error: GitError(Code:ERROR, Class:OS, failed to send request: 操作超时)' Yet I can manually download the SymbolicRegression.jl repository in web browser, which shows the network connection works well (In addtion, I access Github behind proxy). Any idea how to figure out this? Many thanks!

Version

0.16.3

Operating System

Windows

Package Manager

None

Interface

Other (specify below)

Relevant log output

Traceback (most recent call last):
  File "D:\Applications\Python\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Applications\Python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Applications\Python\lib\site-packages\pysr\__main__.py", line 4, in <module>
    _cli(prog_name="pysr")
  File "D:\Applications\Python\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "D:\Applications\Python\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "D:\Applications\Python\lib\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\Applications\Python\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\Applications\Python\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "D:\Applications\Python\lib\site-packages\pysr\_cli\main.py", line 37, in _install
    install(julia_project, quiet, precompile)
  File "D:\Applications\Python\lib\site-packages\pysr\julia_helpers.py", line 109, in install
    _add_sr_to_julia_project(Main, io_arg)
  File "D:\Applications\Python\lib\site-packages\pysr\julia_helpers.py", line 272, in _add_sr_to_julia_project
    Main.eval(f"Pkg.add([sr_spec, clustermanagers_spec], {io_arg})")
  File "D:\Applications\Python\lib\site-packages\julia\core.py", line 627, in eval
    ans = self._call(src)
  File "D:\Applications\Python\lib\site-packages\julia\core.py", line 555, in _call
    self.check_exception(src)
  File "D:\Applications\Python\lib\site-packages\julia\core.py", line 609, in check_exception
    raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
julia.core.JuliaError: Exception 'failed to clone from https://github.com/MilesCranmer/SymbolicRegression.jl, error: GitError(Code:ERROR, Class:OS, failed to send request: 操作超时
)' occurred while calling julia code:
Pkg.add([sr_spec, clustermanagers_spec], io=stderr)

Extra Info

No response

MilesCranmer commented 8 months ago

In addtion, I access Github behind proxy

Hm, this might explain things.

Could you try making a local copy of the PySR repository, and deleting these lines?

https://github.com/MilesCranmer/PySR/blob/2f91f1f3377613949d2a15e5142e6dfef6a5b86c/pysr/julia_helpers.py#L266-L267

Then it should download SymbolicRegression.jl from the Julia package registry instead of GitHub.

Nithouson commented 8 months ago

This solution works. Many thanks! I will close this issue. By the way, I also tried configuring git to work behind proxy: git config --global https.proxy ... Not sure whether this is also necessary.