Mark Kittisopikul commited on
Commit
ca60a8e
1 Parent(s): 1ec1c46

Convert Path to string before setting os.environ["JULIA_PROJECT"]

Browse files
Files changed (1) hide show
  1. pysr/julia_helpers.py +7 -3
pysr/julia_helpers.py CHANGED
@@ -15,14 +15,18 @@ def install(julia_project=None, quiet=False): # pragma: no cover
15
 
16
  # Set JULIA_PROJECT so that we install in the pysr environment
17
  julia_project, is_shared = _get_julia_project(julia_project)
18
- os.environ["JULIA_PROJECT"] = "@" + julia_project if is_shared else julia_project
19
 
20
  import julia
21
 
22
  julia.install(quiet=quiet)
23
 
 
 
 
 
 
24
 
25
- Main = init_julia(julia_project)
26
  Main.eval("using Pkg")
27
 
28
  io = "devnull" if quiet else "stderr"
@@ -81,7 +85,7 @@ def init_julia(julia_project=None):
81
  from julia.core import JuliaInfo, UnsupportedPythonError
82
 
83
  julia_project, is_shared = _get_julia_project(julia_project)
84
- os.environ["JULIA_PROJECT"] = "@" + julia_project if is_shared else julia_project
85
 
86
  try:
87
  info = JuliaInfo.load(julia="julia")
 
15
 
16
  # Set JULIA_PROJECT so that we install in the pysr environment
17
  julia_project, is_shared = _get_julia_project(julia_project)
18
+ os.environ["JULIA_PROJECT"] = "@" + str(julia_project) if is_shared else str(julia_project)
19
 
20
  import julia
21
 
22
  julia.install(quiet=quiet)
23
 
24
+ if is_shared:
25
+ # is_shared is only true if the julia_project arg was None, see _get_julia_project
26
+ Main = init_julia(None)
27
+ else
28
+ Main = init_julia(julia_project)
29
 
 
30
  Main.eval("using Pkg")
31
 
32
  io = "devnull" if quiet else "stderr"
 
85
  from julia.core import JuliaInfo, UnsupportedPythonError
86
 
87
  julia_project, is_shared = _get_julia_project(julia_project)
88
+ os.environ["JULIA_PROJECT"] = "@" + str(julia_project) if is_shared else str(julia_project)
89
 
90
  try:
91
  info = JuliaInfo.load(julia="julia")