MilesCranmer commited on
Commit
a465e93
1 Parent(s): 9d099ff

Print helpful error message if user needs to update

Browse files
Files changed (1) hide show
  1. pysr/sr.py +4 -1
pysr/sr.py CHANGED
@@ -1476,7 +1476,10 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
1476
  Main.eval(f"Pkg.resolve({io_arg})")
1477
  except (JuliaError, RuntimeError) as e:
1478
  raise ImportError(_import_error_string(julia_project)) from e
1479
- Main.eval("using SymbolicRegression")
 
 
 
1480
 
1481
  Main.plus = Main.eval("(+)")
1482
  Main.sub = Main.eval("(-)")
 
1476
  Main.eval(f"Pkg.resolve({io_arg})")
1477
  except (JuliaError, RuntimeError) as e:
1478
  raise ImportError(_import_error_string(julia_project)) from e
1479
+ try:
1480
+ Main.eval("using SymbolicRegression")
1481
+ except (JuliaError, RuntimeError) as e:
1482
+ raise ImportError(_import_error_string(julia_project)) from e
1483
 
1484
  Main.plus = Main.eval("(+)")
1485
  Main.sub = Main.eval("(-)")