No module named ‘_ctypes‘

reason

This module is a built-in module of Python3, and there are problems left after installation.

This module provides data types compatible with C language and calls the shared library under the Linux system through it. This module requires the use of the development link library (header file and link library) of the foreign function library in the system. .

Solution

Centos

yum install libffi-devel -y

Ubuntu

apt-get install libffi-dev

After installing libffi, recompile and install Python3 from source code.

Guess you like

Origin blog.csdn.net/u012206617/article/details/134927925