pip离线安装tar.gz文件报错ModuleNotFoundError: No module named ‘_ctypes‘

报错现象

如下

File"/usr/local/python3.8/lib/python3.8/sitepackages/setuptools/windows_support.py", line 2, in
import ctypes
File "/usr/local/python3.8/lib/python3.8/ctypes/__init__.py", line 7, in
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named ‘_ctypes‘ ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决办法:

重新安装Python3.8.6

解决方法:

需要安装 libffi-devel

yum install libffi-devel -y

重新编译安装python
cd Python-3.8.6/
make clean

make

make install

再次安装离线包

pip3 install --no-index --find-links=./ -r requirements.txt

 

参考

(39条消息) Python 库安装方法:pip安装tar.gz压缩包,pip安装whl文件_挣扎的蓝藻的博客-CSDN博客_pip安装tar.gz
https://blog.csdn.net/qq_38161040/article/details/101784059

(39条消息) python pip安装报错_CentOS7 安装 Python3.8后 pip 安装报错_weixin_39945810的博客-CSDN博客
https://blog.csdn.net/weixin_39945810/article/details/110756484

 

posted @ 2022-06-30 16:54  paul_hch  阅读(684)  评论(0编辑  收藏  举报