private _ctypes unimportable on linux bundle
See original GitHub issueRunning into an issue with our linux build, and wondering if you might have any thoughts?
I built the AppImage with github actions running ubuntu-16.04 as described in the tutorial (full build log and artifacts here). Building and packaging completed, but the packaging step did show a patchelf error:
Setting rpath in ELF file /home/runner/work/napari/napari/linux/napari/napari.AppDir/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/python.o to $ORIGIN
ERROR: Call to patchelf failed:
wrong ELF type
ERROR: Failed to set rpath in ELF file: /home/runner/work/napari/napari/linux/napari/napari.AppDir/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/python.o
When I then downloaded the artifact and tried to run on a local ubuntu machine (18.04) it failed to import numpy with:
File "/tmp/.mount_napari6jrUf5/usr/app_packages/vispy/util/logs.py", line 14, in <module>
import numpy as np
File "/tmp/.mount_napari6jrUf5/usr/app_packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/tmp/.mount_napari6jrUf5/usr/app_packages/numpy/core/__init__.py", line 102, in <module>
from . import _dtype_ctypes
File "/tmp/.mount_napari6jrUf5/usr/app_packages/numpy/core/_dtype_ctypes.py", line 25, in <module>
import _ctypes
ModuleNotFoundError: No module named '_ctypes'
any ideas about that one? thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
ctypes — A foreign function library for Python — Python 3.11.1 ...
ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries....
Read more >Ubuntu 20.04 missing libffi 6 causing bundled python 3 to fail ...
I installed fomu-toolchain-linux_x86_64-v1.5.6 on Ubuntu 20.04 which lacks libffi 6 (7 is the only package in the repos).
Read more >Ctypes linux behavior differs on py2 and py3 - Stack Overflow
In Python 3, all strings are unicode, but libc.fopen() wants simple bytes strings as its arguments: fp = libc.fopen(b'/etc/mtab', b'r').
Read more >ftp://ftp.minsa.gob.pe/sismed/Python27/Lib/site-pa...
On Linux/Unix only system libraries from /lib or /usr/lib are excluded. datas ... changes all bundled Windows SxS Assemblies into Private Assemblies to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It appears that @tlambert03’s analysis was correct; the CPython build didn’t include libFFI, and thus didn’t have a successful _ctypes build.
I’ve just published updated support packages 3.8-b2, 3.7-b2, 3.6-b2 and 3.5-b2; these now include ctypes, and also do a more effective stripping of binary content (so the final AppImage binaries are now much smaller).
Thanks @freakboy3742!