pyjulia icon indicating copy to clipboard operation
pyjulia copied to clipboard

try `PYTHONPATH` in `julia_py_executable` to find julia-py

Open manuelbb-upb opened this issue 4 years ago • 0 comments

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:

  1. When trying to call the build_sysimage function from within a python script, then the julia-py script cannot be found.
  2. When trying
    python -m julia.sysimage sys.img
    
    in the console, then the module is not found, because Python does not know about "/some/dir".

Both approaches can be made to work with the proposed solution:

  1. Set the env var with os.environ["PYTHONPATH"] = "/some/dir" and then call build_sysimage.
  2. Do export PYTHONPATH=/some/dir and then compile the sysimage from the console.

manuelbb-upb avatar Jun 16 '21 12:06 manuelbb-upb