Repository navigation
Closed
Description
I'm experiencing the same error mentioned by @sirgogo in #88 .
oliver@oliver-arch:~ % ipython
Python 3.5.5 |Anaconda, Inc.| (default, Mar 12 2018, 23:12:44)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import julia
In [2]: j = julia.Julia()
Error processing line 1 of /home/oliver/local/miniconda3/lib/python3.5/site-packages/PyUtilib-5.4.1-py2.7-nspkg.pth:
Failed to import the site module
Traceback (most recent call last):
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 167, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/home/oliver/local/miniconda3/lib/python3.5/types.py", line 166, in <module>
import functools as _functools
File "/home/oliver/local/miniconda3/lib/python3.5/functools.py", line 21, in <module>
from collections import namedtuple
File "/home/oliver/local/miniconda3/lib/python3.5/collections/__init__.py", line 29, in <module>
import heapq as _heapq
File "/home/oliver/local/miniconda3/lib/python3.5/heapq.py", line 587, in <module>
from _heapq import *
SystemError: initialization of _heapq did not return an extension module
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 559, in <module>
main()
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 541, in main
known_paths = addsitepackages(known_paths)
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 318, in addsitepackages
addsitedir(sitedir, known_paths)
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 206, in addsitedir
addpackage(sitedir, name, known_paths)
File "/home/oliver/local/miniconda3/lib/python3.5/site.py", line 177, in addpackage
import traceback
File "/home/oliver/local/miniconda3/lib/python3.5/traceback.py", line 3, in <module>
import collections
File "/home/oliver/local/miniconda3/lib/python3.5/collections/__init__.py", line 29, in <module>
import heapq as _heapq
File "/home/oliver/local/miniconda3/lib/python3.5/heapq.py", line 587, in <module>
from _heapq import *
SystemError: initialization of _heapq did not return an extension moduleI'm running Arch Linux and using the following versions:
| Package | Version |
|---|---|
| python | 3.5.5 :: Anaconda, Inc. |
| julia | 0.6.2 |
| PyJulia | 0.1.5 |
| PyCall | 1.15.0 |
Any advice is appreciated!
Thanks,
Oliver
Reacted by Saveliy and Randy Lai
Metadata
Metadata
Assignees
Labels
No labels
Activity
SHTILL commentedon May 11, 2018
Have exactly the same error:
JULIA_HOME = /home/vasya/dist/julia/bin, libjulia_path = /home/vasya/dist/julia/bin/../lib/libjulia.so.0.6
calling jl_init_with_image(b'/home/vasya/anaconda3/lib/python3.6/site-packages/julia/fake-julia', /home/vasya/dist/julia/lib/julia/sys.so)
seems to work...
exception occured? None
exception occured? None
exception occured? None
exception occured? None
Error processing line 1 of /home/vasya/anaconda3/lib/python3.6/site-packages/matplotlib-2.1.2-py3.6-nspkg.pth
matteoacrossi commentedon May 17, 2018
I have a similar error but it happens in
matplotlibSystemError: initialization of _heapq did not return an extension modulecarmagnole commentedon May 24, 2018
I have the same problem:
julia.Julia(debug = True)
JULIA_HOME = /Applications/Julia-0.6.app/Contents/Resources/julia/bin, libjulia_path = /Applications/Julia-0.6.app/Contents/Resources/julia/lib/libjulia.0.6.2.dylib
calling jl_init_with_image(b'/Applications/Julia-0.6.app/Contents/Resources/julia/bin', /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib)
seems to work...
exception occured? None
Failed to import the site module
Traceback (most recent call last):
File "/anaconda3/envs/Neuroscience/lib/python3.6/site.py", line 541, in
main()
File "/anaconda3/envs/Neuroscience/lib/python3.6/site.py", line 522, in main
known_paths = addusersitepackages(known_paths)
File "/anaconda3/envs/Neuroscience/lib/python3.6/site.py", line 282, in addusersitepackages
user_site = getusersitepackages()
File "/anaconda3/envs/Neuroscience/lib/python3.6/site.py", line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/anaconda3/envs/Neuroscience/lib/python3.6/site.py", line 248, in getuserbase
USER_BASE = get_config_var('userbase')
File "/anaconda3/envs/Neuroscience/lib/python3.6/sysconfig.py", line 608, in get_config_var
return get_config_vars().get(name)
File "/anaconda3/envs/Neuroscience/lib/python3.6/sysconfig.py", line 587, in get_config_vars
import _osx_support
File "/anaconda3/envs/Neuroscience/lib/python3.6/_osx_support.py", line 4, in
import re
File "/anaconda3/envs/Neuroscience/lib/python3.6/re.py", line 122, in
import enum
File "/anaconda3/envs/Neuroscience/lib/python3.6/enum.py", line 2, in
from types import MappingProxyType, DynamicClassAttribute
File "/anaconda3/envs/Neuroscience/lib/python3.6/types.py", line 171, in
import functools as _functools
File "/anaconda3/envs/Neuroscience/lib/python3.6/functools.py", line 21, in
from collections import namedtuple
File "/anaconda3/envs/Neuroscience/lib/python3.6/collections/init.py", line 29, in
import heapq as _heapq
File "/anaconda3/envs/Neuroscience/lib/python3.6/heapq.py", line 587, in
from _heapq import *
SystemError: initialization of _heapq did not return an extension module
randy3k commentedon May 26, 2018
I have a similar issue on my conda python, but not the homebrew python.
It may be because JuliaCall fails to detect if (anaconda/miniconda) python has been initialized.
I got the following from my miniconda python
I got the following from my homebrew python
UPDATE:
The following code works in miniconda python
And it seems that PyCall already loads in process symbols JuliaPy/PyCall.jl#293
Not sure the reason now.
bstellato commentedon Oct 24, 2018
I am having the same issue with miniconda. I am also getting the same outputs as in #175 (comment) Any ideas why it cannot detect if python has been initialized?
tkf commentedon Oct 25, 2018
Hmm... I thought I fixed #175 by this commit. Does it happen with PyJulia master as well?
I remember it happened with Julia 0.6 when the precompilation failed.
bstellato commentedon Oct 25, 2018
Yes I am using the master and Julia 1.0. I deleted the
~/.julia/compiled/v1.0/PyCall/xxx.jifile before but it does not seem to help. Thectypescode here in #150 (comment) gives the same answer for me.tkf commentedon Oct 25, 2018
Julia 1.0 with miniconda is not supported ATM so it is supposed to print some informative error message. Are you using Linux?
If you use miniconda in Linux,
python-jlis probably the best way to make it work: https://github.com/tkf/pyjulia/blob/readme/README.md#your-python-interpreter-is-statically-linked-to-libpythonbstellato commentedon Oct 25, 2018
I am using Mac but it actually works with
python-jland Julia 1.0. Thanks a lot! However, it would be great to have the anaconda python working without that hack.tkf commentedon Oct 25, 2018
Good that it works!
BTW, in your comment you are mentioning you tried
ldd, right? Meaning thatdoesn't show libpython? Do you actually have
lddin macOS? I thought it's different command.Additionally, can you run the following in miniconda
python(notpython-jl) you were using?I thought macOS didn't need
python-jl. But iflinked_libpython()above returnsNoneit means our assumption was not correct...Yeah I know... But I can't do anything now. 😿
bstellato commentedon Oct 25, 2018
Sorry, I meant
otool -L! Unfortunately it does not list anything related to libpython.I have tried your commands.
linked_libpython()returnsNone.find_libpython()returns the right library/Users/xxx/miniconda3/envs/python36/lib/libpython3.6m.dylibThanks for the quick responses by the way :)
tkf commentedon Oct 25, 2018
You are welcome :) And thanks for trying the commands. Good to figure out that
linked_libpython()can returnNonein macOS (I mean, it's bad, but better than not knowing it...).Handle statically linked case in macOS as well
Handle statically linked case in macOS as well
Handle statically linked case in macOS as well
Handle statically linked case in macOS as well
sblinz-zz commentedon Nov 5, 2018
Removing
~/.julia/lib/v0.6/PyCall.jlworked for me. System info below:OS: Ubuntu 16.04 (running inside a Docker container)
Julia: 0.6
Python: 3.5.2
Virtual Environment: Conda (rllab, https://github.com/rll/rllab/blob/master/environment.yml)