pyjulia
pyjulia copied to clipboard
Process Error when using julia in python
Hello together, I want to use the DifferentialEquations julia module in python via PyJulia. So I tried to get julia and PyJulia running. I have installed Julia versions 1.4.1 and Python version 3.8.10. But when I try to use any julia module, for example with the following code:
import julia
julia.install()
from julia import Base
I always get the following log-output with error message:
[ Info: Julia version info
Julia Version 1.4.1
Platform Info:
OS: Linux (x86_64-linux-gnu)
Ubuntu 20.04.3 LTS
uname: Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64
CPU: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz:
speed user nice sys idle irq
#1 2304 MHz 11102 s 109 s 2904 s 1807437 s 0 s
#2 2304 MHz 10488 s 21 s 2898 s 1698775 s 0 s
#3 2304 MHz 12425 s 77 s 3045 s 1806027 s 0 s
#4 2304 MHz 7958 s 137 s 2933 s 1701791 s 0 s
#5 2304 MHz 7714 s 93 s 2768 s 1701425 s 0 s
#6 2304 MHz 4788 s 99 s 2038 s 1815790 s 0 s
#7 2304 MHz 10981 s 65 s 3585 s 1697422 s 0 s
#8 2304 MHz 5493 s 25 s 2182 s 1815091 s 0 s
Memory: 7.670402526855469 GB (4687.16015625 MB free)
Uptime: 19332.0 sec
Load Avg: 0.15283203125 0.2890625 0.91845703125
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
HOME = /home/vinc777
TERM = xterm-color
PATH = /bin:/home/vinc777/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/bin/remote-cli:/home/vinc777/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/copasi.org/COPASI 4.34.251/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/MATLAB/R2020b/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/TortoiseSVN/bin:/mnt/c/Users/User/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/User/AppData/Local/Programs/MiKTeX/miktex/bin/x64/:/mnt/c/Users/User/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/User/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin
[ Info: Julia executable: /usr/bin/julia
[ Info: Trying to import PyCall...
┌ Warning: PyCall is already installed. However, you may have trouble using
│ this Python executable because it is statically linked to libpython.
│
│ For more information, see:
│ [https://pyjulia.readthedocs.io/en/latest/troubleshooting.html]()
│
│ Python executable:
│ /bin/python3
│ Julia executable:
│ /usr/bin/julia
└ @ Main ~/.local/lib/python3.8/site-packages/julia/install.jl:90
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
/home/vinc777/masterthesis/two_variant_model/pyjulia/pyjulia.ipynb Cell [1](vscode-notebook-cell://wsl%2Bubuntu/home/vinc777/masterthesis/two_variant_model/pyjulia/pyjulia.ipynb#ch0000000vscode-remote?line=0)' in <module>
1[ import julia
]()[2](vscode-notebook-cell://wsl%2Bubuntu/home/vinc777/masterthesis/two_variant_model/pyjulia/pyjulia.ipynb#ch0000000vscode-remote?line=1)[ julia.install()
----> ]()[3](vscode-notebook-cell://wsl%2Bubuntu/home/vinc777/masterthesis/two_variant_model/pyjulia/pyjulia.ipynb#ch0000000vscode-remote?line=2)[ from julia import Base
File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:975, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:655, in _load_unlocked(spec)
File <frozen importlib._bootstrap>:618, in _load_backward_compatible(spec)
File ~/.local/lib/python3.8/site-packages/julia/core.py:248, in JuliaModuleLoader.load_module(self, fullname)
]()[245](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=244)[ if juliapath == 'Main':
]()[246](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=245)[ return sys.modules.setdefault(fullname,
]()[247](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=246)[ JuliaMainModule(self, fullname))
--> ]()[248](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=247)[ elif self.julia.isafunction(juliapath):
]()[249](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=248)[ return self.julia.eval(juliapath)
]()[251](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=250)[ try:
File ~/.local/lib/python3.8/site-packages/julia/core.py:239, in JuliaModuleLoader.julia(self)
]()[237](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=236)[ @property
]()[238](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=237)[ def julia(self):
--> ]()[239](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=238)[ self.__class__.julia = julia = Julia()
]()[240](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=239)[ return julia
File ~/.local/lib/python3.8/site-packages/julia/core.py:468, in Julia.__init__(self, init_julia, jl_init_path, runtime, jl_runtime_path, debug, **julia_options)
]()[466](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=465)[ self.api = get_libjulia()
]()[467](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=466)[ elif init_julia:
--> ]()[468](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=467)[ jlinfo = JuliaInfo.load(runtime)
]()[469](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=468)[ if jlinfo.version_info < (0, 7):
]()[470](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/core.py?line=469)[ raise RuntimeError("PyJulia does not support Julia < 0.7 anymore")
File ~/.local/lib/python3.8/site-packages/julia/juliainfo.py:87, in JuliaInfo.load(cls, julia, **popen_kwargs)
]()[83](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=82)[ raise subprocess.CalledProcessError(
]()[84](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=83)[ retcode, [julia, "-e", "..."], output
]()[85](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=84)[ )
]()[86](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=85)[ else:
---> ]()[87](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=86)[ raise subprocess.CalledProcessError(
]()[88](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=87)[ retcode, [julia, "-e", "..."], stdout, stderr
]()[89](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=88)[ )
]()[91](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=90)[ stderr = stderr.strip()
]()[92](file:///home/vinc777/.local/lib/python3.8/site-packages/julia/juliainfo.py?line=91)[ if stderr:
CalledProcessError: Command '['julia', '-e', '...']' returned non-zero exit status 1.]()
I already tried reinstalling julia and PyCall and some suggested workarounds for similar problems but it nothing helped.
Maybe someone knows what the problem is.
Thanks Vincent
Mind this warning "┌ Warning: PyCall is already installed. However, you may have trouble using │ this Python executable because it is statically linked to libpython."
https://pyjulia.readthedocs.io/en/stable/troubleshooting.html#your-python-interpreter-is-statically-linked-to-libpython