python安装完毕后,提示找不到ssl模块的解决方示
python安装完毕后,提示找不到ssl模块:
[root@localhost ~]# python2.7.5
Python 2.7.5 (default, Jun 3 2013, 11:08:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python27/lib/python2.7/ssl.py", line 60, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>
2. 查看openssl安装包,发现缺少openssl-devel包
[root@localhost ~]# rpm -aq|grep openssl
openssl-0.9.8e-20.el5
openssl-0.9.8e-20.el5
[root@localhost ~]#
3. yum安装openssl-devel
[root@localhost ~]# yum install openssl-devel -y
#查看安装结果
[root@localhost ~]# rpm -aq|grep openssl
openssl-0.9.8e-26.el5_9.1
openssl-0.9.8e-26.el5_9.1
openssl-devel-0.9.8e-26.el5_9.1
openssl-devel-0.9.8e-26.el5_9.1
4. 重新编译python
#修改Setup文件
vi /usr/software/Python-2.7.5/Modules/Setup
#修改结果如下:
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.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
6. 测试,已可正常使用。
[root@localhost ~]# python2.7.5
Python 2.7.5 (default, Jun 3 2013, 14:56:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
python安装完毕后,提示找不到ssl模块的解决方示的更多相关文章
- python安装完毕后,提示找不到ssl模块的解决步骤
转载自 醇酒醉影 python安装完毕后,提示找不到ssl模块: [root@localhost ~]# python2.7.5 Python 2.7.5 (default, Jun 3 2013, ...
- 关于Oracle安装完毕后,登录时遇到的错误的解决的方法
1 提示无监听服务 解决方法:打开Net Configuration Assistant 依照提示删除现有的监听服务,然后又一次建立一个就可以. 2 SQL Plus登陆时提示username或pas ...
- python安装OpenCV后import cv2报错解决办法
现在python安装完成后,运行pip install opencv-python安装成功后,import cv2时会失败 看到有人给出下载https://www.lfd.uci.edu/~gohlk ...
- pip命令出现了问题,提示说找不到ssl模块
Could not find a version that satisfies the requirement pygame (from versions: ) No matching distrib ...
- Java和Javac的使用时总提示找不到类模块的解决方案
1.场景: 争对网上的很多文章中javac编译与java运行的文章,有很多不明确的地方,使得在合适时发现很多坑.这里给大家作下简介. 2.Javac的使用注意: javac -d ./ ./Insta ...
- cmd 运行py脚本,提示找不到xx模块
一.在学习Django+接口自动化测试,用Jenkins做定时任务,cmd运行脚本时提示 "找不到xx模块": 1.原因:Pycharm单独运行脚本时没问题,cmd运行找不到模块. ...
- Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法
问题: CentOS7安装完毕,重新开机启动后显示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License i ...
- zip方式安装MySQL提示找不到 MSVCP120.dll的解决方法
电脑重装系统后,用zip的方式安装MySQL,在执行mysqld --initialize的时候提示 由于找不到 MSVCP120.dll,无法继续执行代码.重新安装程序可能会解决此问题. 解决的方法 ...
- Android studio 1.x 安装完毕后无法打开问题解决方案
Android Studio 1.0正式发布,给Android开发者带来了不小的惊喜,再也不用为繁琐的环境配置而烦恼,从某一层面上说这降低了android开发门槛. 不过貌似只能开心一会儿,因为and ...
随机推荐
- Spring MVC对象转换说明
在Spring MVC之前我们需要在Servlet里处理HttpServletRequest参数对象,但这个对象里的属性都是通用类型的对象(如字符串),处理起来很繁琐并且容易出错,而Spring MV ...
- LeeCode-Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x. int mySqrt(int x) { ) ; /* for(i ...
- vi常用命令笔记
1.Vi 删除全部内容,删除某行到结尾,删除某段内容 (1)转到文件指定行 nG (2)删除所有内容(先用G转到文件尾) ,使用: $G :1,.d (3)删除第9行到第200行的内容(先用200G转 ...
- Zookeeper 3、Zookeeper工作原理(详细)
1.Zookeeper的角色 » 领导者(leader),负责进行投票的发起和决议,更新系统状态 » 学习者(learner),包括跟随者(follower)和观察者(observer),follow ...
- 移除UIView上面的所有控件
;i<[view.subviews count];i++){ [ [ view.subviews objectAtindex:i] removeFromsuperview]; }
- spark-submit
一旦用户的应用打包后,就可以使用bin/spark-submit脚本来启动,此脚本就会为Spark和它的依赖安排配置环境变量,还支持不同的集群管理和部署模式: ./bin/spark-submit \ ...
- poj1080--Human Gene Functions(dp:LCS变形)
Human Gene Functions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17206 Accepted: ...
- C#中如何只保留小数点后面两位?
string.format("%.4f",1/3) 1.Math.Round(0.333333,2);//按照四舍五入的国际标准2. double dbdata=0.335333; ...
- java concurrent 之 SynchronousQueue
Java 6的并发编程包中的SynchronousQueue是一个没有数据缓冲的BlockingQueue,生产者线程对其的插入操作put必须等待消费者的移除操作take,反过来也一样. 不像Arra ...
- TS相关知识点
数字电视的TS包和TS流的组成和功能 综合考虑几下几个因素: (1)包的长度不能过短,否则包头开销所占比例过大, 导致传输效率下降 (2)包的长度不能过长,否则在丢失同步的情况下恢复同步的 周期过长, ...