Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX 7.1 VMware image: Error import ctypes in Python: (4 Items)
   
QNX 7.1 VMware image: Error import ctypes in Python  
Hi, I created a VMware image for QNX 7.1 X86 with Python installed.  I ran the image using VMware player and in the VM, 
I ran Python.  In Python when I try to import ctypes, I get this error:

Python 3.8.6 (default, Nov 13 2020, 08:25:57)
[GCC 8.3.0 20190222 (lookup) [qnx710 1486#53]] on qnx
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "output/option_files/opt_python_pyc/pyc/ctypes/__init__.py", line 7, in <module>
ImportError: Library cannot be found
>>>

I see that the ctype Python library is installed under /system/lib/python3.8/ctypes.  But I'm not sure why I am getting 
this error.  Any ideas?

Thanks.
Re: QNX 7.1 VMware image: Error import ctypes in Python  
Hi,

(if this appears twice, that's the result of not-quite superb email->foundry27 gateway)

This doesn't seem like a QNX-specific error. Can you show what research you've done so far so we don't repeat all of it?


I get the impression that this an error from ctypes which is trying to import something else which isn't installed. 
Check out line 7 from the file that's indicated (__init__.py) and see what it's trying to import.

regards
-- Michael 
Re: QNX 7.1 VMware image: Error import ctypes in Python  
The Python ctypes module requires the _ctypes.cpython-38.so shared library which transitively requires libffi.so.6. 
Those libraries need to be on the image otherwise you will get that error.
Re: QNX 7.1 VMware image: Error import ctypes in Python  
After copying libffi.so.6 to the VM, I can now import ctypes without any errors.  Thanks for your help.