pyjulia icon indicating copy to clipboard operation
pyjulia copied to clipboard

Can't import Base

Open lesshaste opened this issue 4 years ago • 1 comments

I am trying to use pyjulia for the first time on ubuntu 20.04. julia.install() looks to work perfectly. However I get:

from julia import Base                                                                                    
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-4-5063b14d431c> in <module>
----> 1 from julia import Base

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _load_unlocked(spec)

/usr/lib/python3.8/importlib/_bootstrap.py in _load_backward_compatible(spec)

~/.local/lib/python3.8/site-packages/julia/core.py in load_module(self, fullname)
    246             return sys.modules.setdefault(fullname,
    247                                           JuliaMainModule(self, fullname))
--> 248         elif self.julia.isafunction(juliapath):
    249             return self.julia.eval(juliapath)
    250 

~/.local/lib/python3.8/site-packages/julia/core.py in julia(self)
    237     @property
    238     def julia(self):
--> 239         self.__class__.julia = julia = Julia()
    240         return julia
    241 

~/.local/lib/python3.8/site-packages/julia/core.py in __init__(self, init_julia, jl_init_path, runtime, jl_runtime_path, debug, **julia_options)
    466             self.api = get_libjulia()
    467         elif init_julia:
--> 468             jlinfo = JuliaInfo.load(runtime)
    469             if jlinfo.version_info < (0, 7):
    470                 raise RuntimeError("PyJulia does not support Julia < 0.7 anymore")

~/.local/lib/python3.8/site-packages/julia/juliainfo.py in load(cls, julia, **popen_kwargs)
     85                 )
     86             else:
---> 87                 raise subprocess.CalledProcessError(
     88                     retcode, [julia, "-e", "..."], stdout, stderr
     89                 )

CalledProcessError: Command '['julia', '-e', '...']' returned non-zero exit status 1.

Is this a know problem?

lesshaste avatar Dec 24 '20 17:12 lesshaste

You could try adding the Julia bin file path to the system env variables. I had encountered similar issues after successful installation and editing system variables seems to work for me.

hqs811 avatar Apr 08 '21 13:04 hqs811