centos6.5安装python3.7.1之后无法使用pip的解决方案
编译安装全是坑……
第一遍装完无法使用pip,报错找不到ssl模块。各种报错:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
。。。
configure: error: Invalid --with-openssl value
。。。
结果各种捣鼓。
1、注意cetos6.5自带的openssl版本是1.0.1,需要升级到1.0.2,升级完之后用openssl version检查一下;
2、提前安装好各种依赖包。yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ libffi-devel
3、./configure --prefix=/usr/local/python 之后,需要进到Modules里,修改Setup如下(一般升级完openssl,openssl默认就在/usr/local/ssl文件夹了):
# Socket module helper for socket(2)
_socket socketmodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
把这5行的注释去掉。再进行make && make install,应该就能成功了。如果以前编译失败,记得把原来的Makefile文件删除掉。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对脚本之家的支持。如果你想了解更多相关内容请查看下面相关链接
相关文章
python3中的logging记录日志实现过程及封装成类的操作
这篇文章主要介绍了python3中的logging记录日志实现过程及封装成类的操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2020-05-05
python 解决 pip 时报错 no suchoption: --bulid-dir 的解决办法(最新
在使用PyCharm虚拟环境pip时,有时会遇到错误提示“no such option: --build-dir”,这可能是由于pip版本不兼容或其他原因导致的,本文将详细讲解如何解决这个问题,感兴趣的朋友跟随小编一起看看吧2023-05-05


最新评论