<返回更多

Python3.7编译常见报错之“No module named ‘_ctypes’”

2019-09-09    
加入收藏

之前用的很多都是Python3.6版本,所以不知道3.7版本在编译安装时居然有一个小坑,这里简单记录一下,以作备忘!


报错信息

Traceback (most recent call last):
 File "/opt/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main
 "__main__", mod_spec)
 File "/opt/Python-3.7.0/Lib/runpy.py", line 85, in _run_code
 exec(code, run_globals)
 File "/opt/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module>
 sys.exit(ensurepip._main())
 File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main
 default_pip=args.default_pip,
 File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap
 return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
 File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip
 import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] 错误 1

报错截图:

Python3.7编译常见报错之“No module named ‘_ctypes’”

 


思路

一般位于3.7以上版本编译安装时出错提示缺少依赖包libffi-devel,是由于在安装3.7以上版本时,需要一个新的libffi-devel包做依赖。


解决方法

yum install libffi-devel -y
Python3.7编译常见报错之“No module named ‘_ctypes’”

 

重新make &&make install

Python3.7编译常见报错之“No module named ‘_ctypes’”
声明:本站部分内容来自互联网,如有版权侵犯或其他问题请与我们联系,我们将立即删除或处理。
▍相关推荐
更多资讯 >>>