pyjulia
pyjulia copied to clipboard
try `PYTHONPATH` in `julia_py_executable` to find julia-py
I propose to test the path(s) set in the environment variable PYTHONPATH to be considered as candidates for the julia-py script.
Consider the case when pyjulia has been installed in a non-standard location, e.g., via
pip install --target=/some/dir julia
(The julia-py script is put into /some/dir/bin.)
We can easily get most of the functionality by doing something like
import sys
sys.path.append("/some/dir")
However, compiling a sysimage is not possible:
- When trying to call the
build_sysimagefunction from within a python script, then thejulia-pyscript cannot be found. - When trying
in the console, then the module is not found, because Python does not know about "/some/dir".python -m julia.sysimage sys.img
Both approaches can be made to work with the proposed solution:
- Set the env var with
os.environ["PYTHONPATH"] = "/some/dir"and then callbuild_sysimage. - Do
export PYTHONPATH=/some/dirand then compile the sysimage from the console.