MilesCranmer commited on
Commit
bbfbae6
1 Parent(s): 2e834e3

Better error message for out of date registries

Browse files
Files changed (1) hide show
  1. pysr/sr.py +10 -1
pysr/sr.py CHANGED
@@ -32,7 +32,15 @@ def install(julia_project=None): # pragma: no cover
32
  from julia import Pkg
33
 
34
  Pkg.activate(f"{_escape_filename(julia_project)}")
35
- Pkg.update()
 
 
 
 
 
 
 
 
36
  Pkg.instantiate()
37
  Pkg.precompile()
38
  warnings.warn(
@@ -55,6 +63,7 @@ def import_error_string(julia_project=None):
55
 
56
  return s
57
 
 
58
  Main = None
59
 
60
  already_ran = False
 
32
  from julia import Pkg
33
 
34
  Pkg.activate(f"{_escape_filename(julia_project)}")
35
+ try:
36
+ Pkg.update()
37
+ except RuntimeError as e:
38
+ raise ModuleNotFoundError(
39
+ "Could not update Julia project. "
40
+ "It is possible that your Julia registry is out-of-date. "
41
+ "To switch to an always-updated registry, "
42
+ "see the solution in https://github.com/MilesCranmer/PySR/issues/27."
43
+ ) from e
44
  Pkg.instantiate()
45
  Pkg.precompile()
46
  warnings.warn(
 
63
 
64
  return s
65
 
66
+
67
  Main = None
68
 
69
  already_ran = False