环境:Centos7.5 18-04
目的:在Centos开发好python程序后,需要使用打包工具pyinstaller打包程序。
问题:在centos系统下,已安装好python3.8.2, 并使用pip3安装好pyinstaller。使用打包工具时报了错误ModuleNotFoundError: No module named '_ctypes',如下图所示。
解决方法(不用卸载python3):
1、使用yum install libffi-devel 安装ibffi-devel,但注意, 经过这一步还不行。
2、进入python源文件,分别使用./configure , make, make && make install。
经过上次步骤后,pyinstaller使用正常,如下图。