PyJulia not working with Julia 1.6 and Python 3.9
See original GitHub issueThis looks a lot like: https://github.com/JuliaPy/pyjulia/issues/425 . Apologies ahead of time if this is just adding noise.
I’m working on a Jupyter Docker Image, where we previously supported PyJulia. This was working with an older base image that used Julia 1.2 . We’re now updating to a newer jupyter image, which is pulling Julia 1.6, and PyJulia, has now started failing.
Here’s my code:
from julia.api import Julia
jl = Julia(compiled_modules=False, debug=True)
And here’s the output:
DEBUG (428)
DEBUG (428) Debug-level logging is enabled for PyJulia.
DEBUG (428) PyJulia version: 0.5.6
DEBUG (428)
DEBUG (428) pyprogramname = /opt/conda/bin/python3
DEBUG (428) sys.executable = /opt/conda/bin/python
DEBUG (428) bindir = /opt/julia-1.6.0/bin
DEBUG (428) libjulia_path = /opt/julia-1.6.0/bin/../lib/libjulia.so.1
DEBUG (428) py_libpython = None
DEBUG (428) jl_libpython = /opt/conda/lib/libpython3.9.so.1.0
DEBUG (428) is_compatible_python = False
DEBUG (428) compiled_modules = 'no'
DEBUG (428) argv_list = [b'/opt/conda/bin/python', b'--compiled-modules', b'no']
DEBUG (428) argc = c_int(3)
DEBUG (428) jl_parse_opts called
DEBUG (428) argc = c_int(0)
DEBUG (428) calling jl_init_with_image(/opt/julia-1.6.0/bin, /opt/julia-1.6.0/lib/julia/sys.so)
DEBUG (428) seems to work...
DEBUG (428) exception occured? 140585542159504
---------------------------------------------------------------------------
JuliaError Traceback (most recent call last)
<ipython-input-1-85ca7f15393c> in <module>
5
6 from julia.api import Julia
----> 7 jl = Julia(compiled_modules=False, debug=True)
/opt/conda/lib/python3.9/site-packages/julia/core.py in __init__(self, init_julia, jl_init_path, runtime, jl_runtime_path, debug, **julia_options)
501 # Currently, PyJulia assumes that `Main.PyCall` exsits. Thus, we need
502 # to import `PyCall` again here in case `init_julia=False` is passed:
--> 503 self._call(IMPORT_PYCALL)
504 self._call(u"using .PyCall")
505
/opt/conda/lib/python3.9/site-packages/julia/core.py in _call(self, src)
536 # logger.debug("_call(%s)", src)
537 ans = self.api.jl_eval_string(src.encode('utf-8'))
--> 538 self.check_exception(src)
539
540 return ans
/opt/conda/lib/python3.9/site-packages/julia/core.py in check_exception(self, src)
585 else:
586 exception = sprint(showerror, self._as_pyobj(res))
--> 587 raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
588 .format(exception, src))
589
JuliaError: Exception 'LoadError' occurred while calling julia code:
const PyCall = Base.require(Base.PkgId(Base.UUID("438e738f-606a-5dbb-bf0a-cddfbfd45ab0"), "PyCall"))
I’m working with Jupyter, with an image based on: https://github.com/jupyter/docker-stacks/blob/master/datascience-notebook/Dockerfile (but with PyCall also installed and precompiled via our Dockerfile).
If I run PyCall = Base.require(Base.PkgId(Base.UUID(“438e738f-606a-5dbb-bf0a-cddfbfd45ab0”), “PyCall”)) from the /opt/julia-1.6.0/bin/julia executable, it does work… so it appears PyCall is installed for that executable. I’m unsure how to get PyJulia to see the package - and I’m not sure if I’m missing something obvious.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:15 (1 by maintainers)
I also see the issue with Julia 1.5.1 and python 3.9.
FYI, there’re now PyJulia 0.5.7 and PyCall 1.92.5 that solve a couple of recent issues.