centos7上安装python(centos6.5安装python3.7.1之后无法使用pip的解决方案)
centos7上安装python
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文件删除掉。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对开心学习网的支持。如果你想了解更多相关内容请查看下面相关链接
原文链接:https://blog.csdn.net/zsx0728/article/details/83822645
- python中for循环计算1-100(python 用for循环实现1~n求和的实例)
- python连接到本地的mysql数据库(Python实现连接MySql数据库及增删改查操作详解)
- pythonhtml文件转换成pdf库(Python3转换html到pdf的不同解决方案)
- python的log函数(Python3 log10函数简单用法)
- python中可以改变的数据类型(Python常见数据类型转换操作示例)
- python正式参数(详解Python的三种可变参数)
- python与气象(使用Python和Prometheus跟踪天气的使用方法)
- pythonimage库(Python/Django后端使用PIL Image生成头像缩略图)
- python list基本操作(Python3中列表list合并的四种方法)
- python查找含特定字符的字符串(Python实现查找字符串数组最长公共前缀示例)
- python中怎样使用列表的sort方法(详解python中sort排序使用)
- python经典算法(浅谈python常用程序算法)
- python设置按钮(Python按钮的响应事件详解)
- python如何判断是否为回文数(对python判断是否回文数的实例详解)
- python简单代码画图(python+pyqt5实现图片批量缩放工具)
- python3 for循环怎么用(Python3.5基础之变量、数据结构、条件和循环语句、break与continue语句实例详解)
- 文莱旅游攻略(文莱旅游攻略介绍)
- 马来西亚旅游攻略(马来西亚旅游攻略自由行攻略)
- 缅甸旅游攻略(缅甸旅游攻略必去景点推荐)
- 《庆余年2》新消息,原班人马,肖战特别出演,这才是最好的安排(庆余年2新消息原班人马)
- 宁夏灵武恐龙化石发现始末(宁夏灵武恐龙化石发现始末)
- 到了岁末 临门一脚 节点,天台综合督评会目标直指 全年红(到了岁末临门一脚)
热门推荐
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9