Skip to content
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

Open
robertpyke opened this issue Jun 11, 2021 · 15 comments
Open

PyJulia not working with Julia 1.6 and Python 3.9 #444

robertpyke opened this issue Jun 11, 2021 · 15 comments

Comments

@robertpyke
Copy link

robertpyke commented Jun 11, 2021

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:

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.

@robertpyke
Copy link
Author

robertpyke commented Jun 11, 2021

I should add... if I do:

from julia import Julia
jl = Julia()

I get:

---------------------------------------------------------------------------
UnsupportedPythonError                    Traceback (most recent call last)
<ipython-input-1-6e6fc8d1fac2> in <module>
      1 from julia import Julia
----> 2 jl = Julia()

/opt/conda/lib/python3.9/site-packages/julia/core.py in __init__(self, *args, **kwargs)
    678 
    679     def __init__(self, *args, **kwargs):
--> 680         self.__julia = Julia(*args, **kwargs)
    681 
    682     __init__.__doc__ = Julia.__init__.__doc__

/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)
    481             logger.debug("compiled_modules = %r", options.compiled_modules)
    482             if not (options.compiled_modules == "no" or is_compatible_python):
--> 483                 raise UnsupportedPythonError(jlinfo)
    484 
    485             self.api.init_julia(options)

UnsupportedPythonError: It seems your Julia and PyJulia setup are not supported.

Julia executable:
    julia
Python interpreter and libpython used by PyCall.jl:
    /opt/conda/bin/python3
    /opt/conda/lib/libpython3.9.so.1.0
Python interpreter used to import PyJulia and its libpython.
    /opt/conda/bin/python
    /opt/conda/lib/libpython3.9.so.1.0

Your Python interpreter "/opt/conda/bin/python"
is statically linked to libpython.  Currently, PyJulia does not fully
support such Python interpreter.

The easiest workaround is to pass `compiled_modules=False` to `Julia`
constructor.  To do so, first *reboot* your Python REPL (if this happened
inside an interactive session) and then evaluate:

    >>> from julia.api import Julia
    >>> jl = Julia(compiled_modules=False)

Another workaround is to run your Python script with `python-jl`
command bundled in PyJulia.  You can simply do:

    $ python-jl PATH/TO/YOUR/SCRIPT.py

See `python-jl --help` for more information.

For more information, see:

    https://pyjulia.readthedocs.io/en/latest/troubleshooting.html

I got the same error on our previous Docker image based on Julia 1.2, and using the suggested workaround:

    >>> from julia.api import Julia
    >>> jl = Julia(compiled_modules=False)

did work in that previous case.

@tomMoral
Copy link

Hello,

I happen to be investigating the same issue with a different config. Trying to setup python and julia both from conda-forge on linux. The julia version is different (v1.0 I think) but it used to work a few months back with this same version.

conda create -n test_julia julia python pip
conda activate test_julia
pip install julia
python -c 'import julia; julia.install(); julia.Julia(compiled_modules=False)'

gives the following error

[ Info: Julia version info
Julia Version 1.0.3
Platform Info:
  OS: Linux (x86_64-conda_cos6-linux-gnu)
      "Arch Linux"
  uname: Linux 5.12.9-arch1-1 #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000 x86_64 unknown
  CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz: 
              speed         user         nice          sys         idle          irq
       #1  1694 MHz      21098 s         43 s       6231 s     272265 s        531 s
       #2  2000 MHz      17767 s         71 s       6863 s     272650 s       2399 s
       #3  2000 MHz      19964 s         41 s       6910 s     272253 s        614 s
       #4  2000 MHz      20502 s         70 s       6650 s     273013 s        399 s
       #5  2000 MHz      22198 s         42 s       6391 s     271538 s        455 s
       #6  2000 MHz      23117 s         43 s       6219 s     263781 s       7359 s
       #7  2000 MHz      19565 s         40 s       6244 s     274551 s        385 s
       #8  2000 MHz      20089 s         52 s       7434 s     272184 s        727 s
       
  Memory: 15.352279663085938 GB (4286.47265625 MB free)
  Uptime: 3018.0 sec
  Load Avg:  0.99755859375  1.314453125  1.33642578125
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  CONDA_BACKUP_FFLAGS = -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  CONDA_BACKUP_LDFLAGS = -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/tom/.local/miniconda/lib -Wl,-rpath-link,/home/tom/.local/miniconda/lib -L/home/tom/.local/miniconda/lib
  XDG_DATA_HOME = /home/tom/.data
  CONDA_BACKUP_DEBUG_CFLAGS = -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  CONDA_BACKUP_DEBUG_CPPFLAGS = -D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem /home/tom/.local/miniconda/include
  CONDA_BACKUP_DEBUG_CXXFLAGS = -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  CONDA_BACKUP_DEBUG_FORTRANFLAGS = -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  WINDOWPATH = 2
  HOME = /home/tom
  CONDA_BACKUP_CFLAGS = -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  WORKON_HOME = /home/tom/.local/virtualenvs
  CONDA_BACKUP_CXXFLAGS = -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  TERM = xterm-256color
  CONDA_BACKUP_CMAKE_PREFIX_PATH = /home/tom/.local/miniconda:/home/tom/.local/miniconda/x86_64-conda-linux-gnu/sysroot/usr
  LD_LIBRARY_PATH = :/opt/cuda/lib64:/opt/cuda/extras/CUPTI/lib64
  CONDA_BACKUP_CPPFLAGS = -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/tom/.local/miniconda/include
  CONDA_BACKUP_DEBUG_FFLAGS = -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
  CUDA_HOME = /opt/cuda
  PATH = /home/tom/.local/miniconda/envs/test_julia/bin:/home/tom/.local/miniconda/condabin:/home/tom/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  CONDA_BACKUP_FORTRANFLAGS = -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tom/.local/miniconda/include
[ Info: Julia executable: /home/tom/.local/miniconda/envs/test_julia/bin/julia
[ Info: Trying to import PyCall...
┌ Error: `import PyCall` failed
│   exception =
│    ArgumentError: Package PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] is required but does not seem to be installed:
│     - Run `Pkg.instantiate()` to install all recorded dependencies.
│    
│    Stacktrace:
│     [1] _require(::Base.PkgId) at ./loading.jl:929
│     [2] require(::Base.PkgId) at ./loading.jl:858
│     [3] top-level scope at /home/tom/.local/miniconda/envs/test_julia/lib/python3.9/site-packages/julia/install.jl:36
│     [4] include at ./boot.jl:317 [inlined]
│     [5] include_relative(::Module, ::String) at ./loading.jl:1044
│     [6] include(::Module, ::String) at ./sysimg.jl:29
│     [7] exec_options(::Base.JLOptions) at ./client.jl:266
│     [8] _start() at ./client.jl:425
└ @ Main ~/.local/miniconda/envs/test_julia/lib/python3.9/site-packages/julia/install.jl:38
[ Info: Installing PyCall...
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│     — /home/tom/.julia/registries/General — failed to fetch from repo
└ @ Pkg.API /home/conda/feedstock_root/build_artifacts/julia_1548684429855/work/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:157
 Resolving package versions...
 Installed PyCall ─ v1.92.3
  Updating `~/.julia/environments/v1.0/Project.toml`
  [438e738f] + PyCall v1.92.3
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [8f4d0f93] + Conda v1.5.2
  [682c06a0] + JSON v0.21.1
  [1914dd2f] + MacroTools v0.5.6
  [69de0a69] + Parsers v1.1.0
  [438e738f] + PyCall v1.92.3
  [81def892] + VersionParsing v1.2.0
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [d6f4376e] + Markdown 
  [a63ad114] + Mmap 
  [de0858da] + Printf 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [4ec0a83e] + Unicode 
  Building PyCall → `~/.julia/packages/PyCall/BD546/deps/build.log`

Precompiling PyCall...
Precompiling PyCall... DONE
PyCall is installed and built successfully.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/tom/.local/miniconda/envs/test_julia/lib/python3.9/site-packages/julia/core.py", line 680, in __init__
    self.__julia = Julia(*args, **kwargs)
  File "/home/tom/.local/miniconda/envs/test_julia/lib/python3.9/site-packages/julia/core.py", line 503, in __init__
    self._call(IMPORT_PYCALL)
  File "/home/tom/.local/miniconda/envs/test_julia/lib/python3.9/site-packages/julia/core.py", line 538, in _call
    self.check_exception(src)
  File "/home/tom/.local/miniconda/envs/test_julia/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"))

When calling the increminated line directly in julia, this works well:

julia -e 'const PyCall = Base.require(Base.PkgId(Base.UUID("438e738f-606a-5dbb-bf0a-cddfbfd45ab0"), "PyCall"))'

Also, when using python=3.8, this works fine.
I am a bit at loss on how to debug this one but it would be nice to know what are the core difference between calling the julia version and the one called with pyjulia and if python3.9 might have broken some mechanisms that were used for pyjulia.

@opus111
Copy link

opus111 commented Jul 21, 2021

Adding my 2 cents. It is failing on OSX

>>> import julia
>>> julia.install()
[ Info: Julia version info
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Thu May  6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64 x86_64 i386
  CPU: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz: 
              speed         user         nice          sys         idle          irq
       #1  2900 MHz    1515238 s          0 s    1452037 s    3012217 s          0 s
       #2  2900 MHz     285259 s          0 s     254787 s    5439432 s          0 s
       #3  2900 MHz    1256696 s          0 s    1054259 s    3668523 s          0 s
       #4  2900 MHz     273480 s          0 s     216112 s    5489885 s          0 s
       #5  2900 MHz    1185945 s          0 s     937479 s    3856054 s          0 s
       #6  2900 MHz     280677 s          0 s     203511 s    5495289 s          0 s
       #7  2900 MHz    1141879 s          0 s     859332 s    3978266 s          0 s
       #8  2900 MHz     293439 s          0 s     198940 s    5487097 s          0 s
       
  Memory: 16.0 GB (259.515625 MB free)
  Uptime: 620701.0 sec
  Load Avg:  3.2177734375  4.1640625  4.79052734375
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = emacsclient
  JULIA_HOME = /Applications/Julia-1.6.app/Contents/Resources/julia
  TERM = xterm-256color
  PATH = /Users/peter.wolf/opt/anaconda3/envs/phinder/bin:/Users/peter.wolf/opt/anaconda3/condabin:/Users/peter.wolf/.cargo/bin:/Applications/Julia-1.6.app/Contents/Resources/julia/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home
  XPC_FLAGS = 0x0
  HOME = /Users/peter.wolf
  JULIA_HOME = /Applications/Julia-1.6.app/Contents/Resources/julia
[ Info: Julia executable: /Applications/Julia-1.6.app/Contents/Resources/julia/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:
│     /Users/peter.wolf/opt/anaconda3/envs/phinder/bin/python
│ Julia executable:
│     /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
└ @ Main ~/opt/anaconda3/envs/phinder/lib/python3.9/site-packages/julia/install.jl:90
>>> 
>>> from julia.api import Julia
>>> jl = Julia(compiled_modules=False)
ERROR: Segmentation fault: 11

@mhangaard
Copy link

mhangaard commented Jul 29, 2021

I also see the issue with Julia 1.5.1 and python 3.9.

2021-07-29T14:18:54.2226731Z   File "/home/hafnium/miniconda3/lib/python3.9/site-packages/julia/core.py", line 680, in __init__
2021-07-29T14:18:54.2227274Z     self.__julia = Julia(*args, **kwargs)
2021-07-29T14:18:54.2228006Z   File "/home/hafnium/miniconda3/lib/python3.9/site-packages/julia/core.py", line 503, in __init__
2021-07-29T14:18:54.2228529Z     self._call(IMPORT_PYCALL)
2021-07-29T14:18:54.2229247Z   File "/home/hafnium/miniconda3/lib/python3.9/site-packages/julia/core.py", line 538, in _call
2021-07-29T14:18:54.2229768Z     self.check_exception(src)
2021-07-29T14:18:54.2230501Z   File "/home/hafnium/miniconda3/lib/python3.9/site-packages/julia/core.py", line 587, in check_exception
2021-07-29T14:18:54.2231377Z     raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
2021-07-29T14:18:54.2232132Z julia.core.JuliaError: Exception 'LoadError' occurred while calling julia code:
2021-07-29T14:18:54.2233270Z const PyCall = Base.require(Base.PkgId(Base.UUID("438e738f-606a-5dbb-bf0a-cddfbfd45ab0"), "PyCall"))

@andrewkhardy
Copy link

The only way I found around this issue was reverting to Python 3.8.8

@ShuhuaGao
Copy link

Same issue

Environment

  • Julia 1.6.1
  • Python 3.9.5 (NOT in conda)
  • Ubuntu 21.04

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

@ShuhuaGao
Copy link

The only way I found around this issue was reverting to Python 3.8.8

Does Python 3.8.8 work with Julia 1.6?

@deklanw
Copy link

deklanw commented Aug 29, 2021

Creating a Conda environment with Python 3.8.8 fixed this for me.

@valentinsulzer
Copy link

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

@valentinsulzer
Copy link

JuliaLang/julia#40246

@tkf
Copy link
Member

tkf commented Oct 25, 2021

FYI, there're now PyJulia 0.5.7 and PyCall 1.92.5 that solve a couple of recent issues.

@amrit-poudel
Copy link

amrit-poudel commented Nov 5, 2021

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.

@dinarior
Copy link

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.

@Immich
Copy link

Immich commented Jan 27, 2022

@dinarior are you using a conda or a venv environment?

@dinarior
Copy link

@Immich conda in all 3 cases. Used pip for the installations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests