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模块的解决方示的更多相关文章

  1. python安装完毕后,提示找不到ssl模块的解决步骤

    转载自 醇酒醉影 python安装完毕后,提示找不到ssl模块: [root@localhost ~]# python2.7.5 Python 2.7.5 (default, Jun 3 2013, ...

  2. 关于Oracle安装完毕后,登录时遇到的错误的解决的方法

    1 提示无监听服务 解决方法:打开Net Configuration Assistant 依照提示删除现有的监听服务,然后又一次建立一个就可以. 2 SQL Plus登陆时提示username或pas ...

  3. python安装OpenCV后import cv2报错解决办法

    现在python安装完成后,运行pip install opencv-python安装成功后,import cv2时会失败 看到有人给出下载https://www.lfd.uci.edu/~gohlk ...

  4. pip命令出现了问题,提示说找不到ssl模块

    Could not find a version that satisfies the requirement pygame (from versions: ) No matching distrib ...

  5. Java和Javac的使用时总提示找不到类模块的解决方案

    1.场景: 争对网上的很多文章中javac编译与java运行的文章,有很多不明确的地方,使得在合适时发现很多坑.这里给大家作下简介. 2.Javac的使用注意: javac -d ./ ./Insta ...

  6. cmd 运行py脚本,提示找不到xx模块

    一.在学习Django+接口自动化测试,用Jenkins做定时任务,cmd运行脚本时提示 "找不到xx模块": 1.原因:Pycharm单独运行脚本时没问题,cmd运行找不到模块. ...

  7. Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法

    问题: CentOS7安装完毕,重新开机启动后显示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License i ...

  8. zip方式安装MySQL提示找不到 MSVCP120.dll的解决方法

    电脑重装系统后,用zip的方式安装MySQL,在执行mysqld --initialize的时候提示 由于找不到 MSVCP120.dll,无法继续执行代码.重新安装程序可能会解决此问题. 解决的方法 ...

  9. Android studio 1.x 安装完毕后无法打开问题解决方案

    Android Studio 1.0正式发布,给Android开发者带来了不小的惊喜,再也不用为繁琐的环境配置而烦恼,从某一层面上说这降低了android开发门槛. 不过貌似只能开心一会儿,因为and ...

随机推荐

  1. UESTC_邱老师选妹子(二) 2015 UESTC Training for Dynamic Programming<Problem I>

    I - 邱老师选妹子(二) Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Su ...

  2. 操作系统基本概念(内核态与用户态、操作系统结构)-by sixleaves

    内核态与用户态(为什么存在这种机制.程序应处于哪个状态.如何判断当前所处状态.哪些功能需要内核态.如何实现这种机制) 1.首先我们应该思考清楚为什么会有内核态和用户态?(为什么存在这种机制) 因为计算 ...

  3. html5 laboratory - drawing in the canvas

    html5 laboratory - drawing in the canvas Creating a bar chart with canvas 21st February 2010 The exp ...

  4. Python 自动化脚本学习(一)

    Python 基础 命令行:在http://www.python.org安装python3,Mac下输入python3进入命令行 整数,浮点数,字符串类型:-1,0.1,'game' 字符串连接和复制 ...

  5. mysql、sqlServer、hsql、oracle、db2各数据库支持的字段类型与最大精度

  6. html css js 框架

    html css js 框架 Bootstrap http://www.bootcss.com/ http://www.cnblogs.com/aehyok/p/3404867.html        ...

  7. <runtime> 的 <assemblyIdentity> 元素和<bindingRedirect> 元素

    1.<assemblyIdentity> 元素 包含关于该程序集的标识信息. <assemblyIdentity name="assembly name" pub ...

  8. 伪元素”:after” , “:before"

    伪元素就是源码html中不存在,而视觉上又存在的元素     简单用法: blockquote:before {      content: open-quote;      // 其他样式 } // ...

  9. media type 与 media query

    参考博客:http://www.qianduan.net/media-type-and-media-query.html media type(媒体类型)是css 2中的一个非常有用的属性,通过med ...

  10. PHP环境出现时区问题

    如下图所示,php执行的时候出现如下提示: 解决办法: 重新设置php编译的时区. 具体方法如下: 1. 找到php.ini文件: 2. 修改php.ini文件中的date.timezone的值,将其 ...