RuntimeError: $PATH error, Julia not found.
Zymrael opened this issue · comments
Hi Miles!
I spent a few minutes trying to find out why the package kept raising RuntimeError: $PATH error, Julia not found
even though Julia was callable from shell and was present in $PATH
. Modifying all the calls to subprocess.Popen
to include shell=True
makes this issue go away (Ubuntu 18.04, called from a jupyter lab
instance). For example
process = subprocess.Popen(["julia", "-v"], stdout=subprocess.PIPE, bufsize=-1)
to
process = subprocess.Popen(["julia", "-v"], shell=True, stdout=subprocess.PIPE, bufsize=-1)
.
Not sure if there's a good reason for keeping shell=False
for the initial call -- perhaps adding a secondary check with shell
enabled after the first one fails might help make the first experience with PySR
smoother for new users.
EDIT: some additional documentation
Hey Michael! Very happy to see you trying out PySR :). (Sorry for the late response by the way - I was busy moving apartments last 1.5 weeks).
Good point about shell=True
. I think it was there originally, but was taken out to be compatible on Windows maybe?? But I will look at including this back in.
Just to check, can you run import os; print(os.environ['PATH'])
before the bug occurs? I want to check if that python instance is copying in your $PATH variable or not.
Cheers,
Miles
Cool, totally understand! Moving is always rather stressful. I've been using both the Julia version and pysr
and both have definitely made my experimentation with symbolic regression more enjoyable.
os.environ['PATH']
from IPython
does not contain the Julia path, likely stemming from a misconfigured setup on this particular remote server I was working on. Thee workarounds for posterity:
shell=True
as mentioned above.- manually adding the Julia path e.g
...julia-1.6.0/bin
toos.environ['PATH']
- and of course, the best approach is to solve the root problem and ensure matching PATHs, although this is not always possible / convenient (in example requiring a restart, which is case of remote servers running several jobs, might take some time).
I'd suggest holding off on changing to shell=True
for now unless others encounter similar issues. My remark here should be enough for future users of pysr
:). I'll close the issue for the moment.