pyjulia
pyjulia copied to clipboard
Pyjulia not working on Julia 1.6
When I try to install and work with Python3.9.3 with Julia 1.6, the command
julia.install()
works well, but later
from julia import Base # or
Pkg
,Main
..etc
leads to segmentation fail, and python exits without other error messages inside terminal.
Then I reinstalled julia 1.5, all commands works well.
System: MacOS Big Sur with Command Line Tools
I tried with Python 3.8.6 and Julia 1.6 on Kubuntu 20.10 and everything worked fine. I did:
import julia
julia.install()
jl = julia.Julia(compiled_modules=False)
from julia import Base
Base.sind(90)
On the Python REPL.
I have the same issue: MacOS Big Sur. Python 3.8.8 [Clang 10.0.0 ] :: Anaconda, Inc. on darwin julia version 1.6.0
For reference, there is a similar problem for 1.6 with JuliaCall in R on macOS: https://github.com/Non-Contradiction/JuliaCall/issues/164
So it seems to be a bug in Julia, the issue is being tracked here: https://github.com/JuliaLang/julia/issues/40246
Same problem here. I'm currently using 1.5.3 until this problems fixed.
I posted this in https://github.com/JuliaLang/julia/issues/40246, but I'm going to post it here as well to get a bit more exposure.
So I've been doing some testing trying to get macOS 11.4, Python 3.9, and Julia 1.6 working with pyjulia 0.5.6, and I think I found a way to get it to work somewhat.
Some notes:
- I am using the Julia 1.6 macOS binary downloaded from julialang.org which exists in
/Applications/Julia-1.6.app
. - I have symlinked the julia binary to my
/usr/local/bin
like soln -s /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia1.6
and then whenever I change my default julia I symlink it again like so:ln -s /usr/local/bin/julia1.6 /usr/local/bin/julia
- I am doing this in a python 3.9 venv
So my first few observations.
- I had tried this with the Julia 1.7 beta and noticed a few extra debug lines.
- As others have mentioned, it seems like
jl_
is unexported. As a test I just commented out these lines: https://github.com/JuliaPy/pyjulia/blob/master/src/julia/libjulia.py#L34-L35 as it doesn't seem likejl_
is used anywhere? - I noticed that I was getting the error:
ERROR: could not load library "libjulia.1.dylib"
dlopen(libjulia.1.dylib, 1): image not found
-
libjulia.1.dylib
exists in/Applications/Julia-1.6.app/Contents/Resources/julia/lib
but it seems to be looking in/Applications/Julia-1.6.app/Contents/Resources/julia/lib/julia
instead, so I symlinkedlibjulia.1.dylib
into thelib/julia
folder and it stopped segfaulting. - This seems weird to me since 1.5 didn't have that file in that folder either, so I'm not sure why it's looking for it there now.
- Then I saw an error that it wouldn't find
libjulia.dylib
which I just applied the same symlink fix as above and then I had no issues
So, as far as I can tell, the issue is that jl_
isn't exported anymore and pyjulia just checks for its existence, and also julia is looking for libjulia.1.dylib
and libjulia.dylib
in the wrong place?
Hoping this info might help in some way!
This could be "fixed" for 1.6 by removing the is_windows
condition here:
https://github.com/JuliaPy/pyjulia/blob/87c669e2729f9743fe2ab39320ec9b91c9300a96/src/julia/libjulia.py#L221-L222
(see https://github.com/JuliaLang/julia/issues/40246#issuecomment-912223287)
Hi, I have it working with Julia 1.6, but with 1.7 I get an error due to missing jl_ Should we change the name of the issue? or create a new one?
@dpinol https://github.com/JuliaPy/pyjulia/issues/451
There's now PyJulia 0.5.7 and PyCall 1.92.5 that solved a couple of recent issues. It includes @ihnorton's suggestion https://github.com/JuliaPy/pyjulia/issues/437#issuecomment-912223632
There's now PyJulia 0.5.7
~~It doesn't look like this has been tagged and registered yet?~~
Edit: Oh wait, this is Python not Julia, it works differently. I was confused haha
I finally had a chance to try this out. PyJulia 0.5.7 Works perfect on MacOS with Julia 1.6 now. Thanks so much!