How can I resolve the '_ctypes' error when importing 'qi' module with Python-SDK for Nao on Linux?

63 Views Asked by At

Issues with installing Python-SDK for Nao

I have installed python-sdk for the Nao robot in my VM which runs in Linux 5.10.0-20-arm64 #1 SMP Debian 5.10.158-2 (2022-12-13) aarch64 GNU/Linux. I have followed this website to install pyhton-sdk. I also set the environment variable according to the right path to the newly installed pyhton-sdk. However, when I download Python2.7 and install it, upon running import qi, I get the following error.

Python 2.7 (r27:82500, May 18 2023, 14:23:46) 
[GCC 10.2.1 20210110] on linux5
Type "help", "copyright", "credits" or "license" for more information.
>>> import qi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qi/__init__.py", line 14, in <module>
    import ctypes
  File "/usr/local/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>> 

I have also reinstalled libffi. Still, no luck. I have spent almost two days fixing the issue. Any kind of help will be appreciated.

1

There are 1 best solutions below

0
Victor Paléologue On

This SDK is made for amd64 processors, there is no support for arm64.

You can use libqi-python instead. You will need to recompile it. But the good news is that you will be able to work with Python 3.