python3安装过程报错解决

python3安装过程报错解决

错误一

zipimport.ZipImportError: can't decompress data; zlib not available Makefile:1099: recipe for target 'install' failed make: *** [install] Error 1

解决方案

需要安装依赖

yum -y install zlib1g-dev

错误二

ModuleNotFoundError: No module named '_ctypes'

解决方案

需要安装依赖

yum -y install libffi-devel

安装pipenv

在centos中使用python3.7或以上版本,进行pip install 命令容易报错

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https:*******: There was a problem confirming the ssl certificate: 
Can't connect to HTTPS URL because the SSL module is not available. - skipping

解决方案

在./configure过程中,如果没有加上–with-ssl参数时,默认安装的软件涉及到ssl的功能不可用,刚好pip3过程需要ssl模块,而由于没有指定,所以该功能不可用。解决办法是重新对python3.7进行编译安装,用一下过程来实现编译安装:

cd Python-3.7.2
./configure --with-ssl
make && make install

即可正常使用pip安装.

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏
分享
评论 抢沙发