question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

private _ctypes unimportable on linux bundle

See original GitHub issue

Running 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
freakboy3742commented, May 27, 2020

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).

0reactions
tlambert03commented, May 27, 2020

Thanks @freakboy3742!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found