pyjulia icon indicating copy to clipboard operation
pyjulia copied to clipboard

cannot create system image

Open thautwarm opened this issue 6 years ago • 6 comments

To counter the problem of statically linked Python, I tried to compile the custom system image, however, got this just now

Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "/home/redbq/Software/Anaconda/lib/python3.7/site.py", line 168, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "/home/redbq/Software/Anaconda/lib/python3.7/importlib/util.py", line 14, in <module>
    from contextlib import contextmanager
  File "/home/redbq/Software/Anaconda/lib/python3.7/contextlib.py", line 5, in <module>
    from collections import deque
  File "/home/redbq/Software/Anaconda/lib/python3.7/collections/__init__.py", line 24, in <module>
    import heapq as _heapq
  File "/home/redbq/Software/Anaconda/lib/python3.7/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/redbq/Software/Anaconda/lib/python3.7/site.py", line 586, in <module>
    main()
  File "/home/redbq/Software/Anaconda/lib/python3.7/site.py", line 573, in main
    known_paths = addsitepackages(known_paths)
  File "/home/redbq/Software/Anaconda/lib/python3.7/site.py", line 349, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/home/redbq/Software/Anaconda/lib/python3.7/site.py", line 207, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/home/redbq/Software/Anaconda/lib/python3.7/site.py", line 178, in addpackage
    import traceback
  File "/home/redbq/Software/Anaconda/lib/python3.7/traceback.py", line 3, in <module>
    import collections
  File "/home/redbq/Software/Anaconda/lib/python3.7/collections/__init__.py", line 24, in <module>
    import heapq as _heapq
  File "/home/redbq/Software/Anaconda/lib/python3.7/heapq.py", line 587, in <module>
    from _heapq import *
SystemError: initialization of _heapq did not return an extension module

thautwarm avatar Sep 16 '19 10:09 thautwarm

This seems to be the issue with incompatible precompilation files. The easiest workaround at the moment is to remove PyCall's precompilation cache. PyJulia can probably do something clever to avoid this, though.

tkf avatar Sep 16 '19 18:09 tkf

The easiest workaround at the moment is to remove PyCall's precompilation cache.

More precisely something like rm -r ~/.julia/compiled/v1.$x/PyCall with appropriate $x.

tkf avatar Sep 17 '19 01:09 tkf

ref #325

tkf avatar Sep 17 '19 02:09 tkf

I am having exactly the same problem. Removed the precompilation files as suggested above, but this did not help. Also removed the whole ~/.julia and started from scratch, but got the same error.

graidl avatar Oct 23 '19 14:10 graidl

Besides, this message is the same as that you start julia via ctypes and libjulua and eval using PyCall in this julia session.

thautwarm avatar Oct 23 '19 15:10 thautwarm

Works now for me in version 0.5.0, problem was in former version.

graidl avatar Nov 04 '19 06:11 graidl