-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyJulia not working with Julia 1.6 and Python 3.9 #444
Comments
I should add... if I do:
I get:
I got the same error on our previous Docker image based on Julia 1.2, and using the suggested workaround:
did work in that previous case. |
Hello, I happen to be investigating the same issue with a different config. Trying to setup
gives the following error
When calling the increminated line directly in
Also, when using |
Adding my 2 cents. It is failing on OSX
|
I also see the issue with Julia 1.5.1 and python 3.9.
|
The only way I found around this issue was reverting to Python 3.8.8 |
Same issue Environment
To reproduce: >>> from julia.api import Julia
>>> jl = Julia(compiled_modules=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/shuhua/.local/lib/python3.9/site-packages/julia/core.py", line 503, in __init__
self._call(IMPORT_PYCALL)
File "/home/shuhua/.local/lib/python3.9/site-packages/julia/core.py", line 538, in _call
self.check_exception(src)
File "/home/shuhua/.local/lib/python3.9/site-packages/julia/core.py", line 587, in check_exception
raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
julia.core.JuliaError: Exception 'LoadError' occurred while calling julia code:
const PyCall = Base.require(Base.PkgId(Base.UUID("438e738f-606a-5dbb-bf0a-cddfbfd45ab0"), "PyCall")) The default Julia environment is (@v1.6) pkg> st
Status `~/.julia/environments/v1.6/Project.toml`
[7073ff75] IJulia v1.23.2
[5fb14364] OhMyREPL v0.5.10
[14b8a8f1] PkgTemplates v0.7.17
[438e738f] PyCall v1.92.3 |
Does Python 3.8.8 work with Julia 1.6? |
Creating a Conda environment with Python 3.8.8 fixed this for me. |
Also got a segfault with python 3.9.6 and julia 1.6.0 on Mac M1 Python 3.9.6 (default, Jun 29 2021, 05:25:02)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.25.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import julia
In [2]: julia.install()
[ Info: Julia version info
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.6.0)
uname: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 x86_64 i386
CPU: Apple M1:
speed user nice sys idle irq
#1 24 MHz 1340987 s 0 s 1088688 s 4442509 s 0 s
#2 24 MHz 1275400 s 0 s 1008222 s 4588063 s 0 s
#3 24 MHz 1171703 s 0 s 933308 s 4766677 s 0 s
#4 24 MHz 1081966 s 0 s 849748 s 4939963 s 0 s
#5 24 MHz 1489453 s 0 s 450709 s 4931517 s 0 s
#6 24 MHz 1160876 s 0 s 277893 s 5432911 s 0 s
#7 24 MHz 906581 s 0 s 207892 s 5757208 s 0 s
#8 24 MHz 796541 s 0 s 170770 s 5904364 s 0 s
Memory: 16.0 GB (69.68359375 MB free)
Uptime: 1.310481e6 sec
Load Avg: 8.27880859375 9.443359375 9.29296875
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, westmere)
Environment:
PATH = /Users/vsulzer/Documents/Energy_storage/PyBaMM/venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/usr/local/Caskroom/miniforge/base/bin:/usr/local/Caskroom/miniforge/base/condabin
HOME = /Users/vsulzer
XPC_FLAGS = 0x0
TERM = xterm-256color
DYLD_LIBRARY_PATH = /Users/vsulzer/Documents/Energy_storage/PyBaMM/sundials/lib:
[ Info: Julia executable: /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
[ Info: Trying to import PyCall...
┌ Info: PyCall is already installed and compatible with Python executable.
│
│ PyCall:
│ python: /Users/vsulzer/Documents/Energy_storage/PyBaMM.jl/venv/bin/python
│ libpython: /usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/Python
│ Python:
│ python: /Users/vsulzer/Documents/Energy_storage/PyBaMM/venv/bin/python
└ libpython: /usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/Python
In [3]: from julia import Main
ERROR: [1] 5531 segmentation fault ipython |
FYI, there're now PyJulia 0.5.7 and PyCall 1.92.5 that solve a couple of recent issues. |
Do julia v 1.6 with Pycall 1.92.5 and python v > 3.9 work with py julia v 0.5.7 in macosx v 11.6? Trying to decide whether to upgrade to julia v1.6. Any information would be greatly appreciated. Thanks. |
Using Python 3.9.9, Julia 1.6.2, PyCall 1.93.0, PyJulia 0.5.7 the bug is fixed for me. The same setting with PyCall 1.92.3 was broken, while a similar setting with Python 3.8 worked. |
@dinarior are you using a conda or a venv environment? |
@Immich conda in all 3 cases. Used pip for the installations. |
This looks a lot like: #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:
And here's the output:
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.
The text was updated successfully, but these errors were encountered: