文章转自:http://write.blog.csdn.net/postedit/51725016

1.测试

[root@s011805161450 ~]# python

Python 2.7.8 (default, Jun 17 2016, 01:25:39) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] 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/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.查看

[root@s011805161450 ~]# yum list installed | grep ssl
openssl.x86_64          1.0.0-27.el6    @anaconda-CentOS-201303020151.x86_64/6.4

3.安装

[root@s011805161450 ~]# yum install openssl-devel -y

4.查看结果

[root@s011805161450 ~]# rpm -aq|grep openssl
openssl-1.0.1e-48.el6_8.1.x86_64
openssl-devel-1.0.1e-48.el6_8.1.x86_64

5.重新编译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

6.重新编译

make
make install

7.测试结果

[root@s011805161450 ~]# python
Python 2.7.8 (default, Jun 21 2016, 17:51:18) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
>>> exit()

转载于:https://www.cnblogs.com/Gnnnny/p/9185126.html

(转)输入pipt提示:AttributeError: 'module' object has no attribute 'HTTPSConnection'相关推荐

  1. Python 报错解决:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    早上升级完pip,后报错如下: -> # pip install --upgrade pwntools /usr/local/lib/python2.7/dist-packages/pip/_v ...

  2. AttributeError: 'module' object has no attribute 'text_format'

    最近在学习 faster rcnn ,本来环境已经配置好,已经跑完自己的程序,运行良好,后来安装了tensorflow,然后重新使用 faster rcnn 进行训练的时候居然出错了,我很纳闷,期间没 ...

  3. Tensorflow报错:AttributeError: 'module' object has no attribute 'scalar_summary'

    报错: tf.scalar_summary(l.op.name + ' (raw)', l) AttributeError: 'module' object has no attribute 'sca ...

  4. Python AttributeError: 'module' object has no attribute 'posseg'

    AttributeError: 'module' object has no attribute 'posseg' 遇到问题: 如果 a 是个目录, b 是个 b.py 文件, func 是 b.py ...

  5. pytorch版本问题:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'

    用pytorch加载训练好的模型的时候遇到了如下的问题: AttributeError: 'module' object has no attribute '_rebuild_tensor_v2' 到 ...

  6. tensorflow出现如下错误:AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’

    tensorflow版本问题,导致函数的变化,summary使用如下变化机制: AttributeError: 'module' object has no attribute 'merge_all_ ...

  7. AttributeError: 'module' object has no attribute 'get_frontal_face_detector'

    AttributeError: 'module' object has no attribute 'get_frontal_face_detector' 报错原因: 命名为的文件将遮盖dlib具有所需 ...

  8. Python3.X识别混合编码,顺便解决“AttributeError: 'module' object has no attribute 'urlopen'”

    原本是想利用chardet模块识别一个混合编码网页的编码类型(以百度为例),然而运行脚本发现python3.X中出现"AttributeError: 'module' object has ...

  9. AttributeError: 'module' object has no attribute '_base'

    较为完整的错误信息是: class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):   AttributeError: ...

最新文章

  1. Ubuntu-16.04 部署 OpenStack Ocata下
  2. 802.11成帧封装实现(四)
  3. 【FBA】SharePoint 2013自定义Providers在基于表单的身份验证(Forms-Based-Authentication)中的应用...
  4. AAAIT学院JDK15新特性历史
  5. CMD安装/删除服务
  6. Python应用实战-Pandas 计算连续行为天数的几种思路
  7. 【转】excel表格导出集锦repeater实用,和普通用法
  8. java byte[] 文件流 转换成string是乱码_Java学习--IO(二)、多线程
  9. c 语言开发一个四则运算器,C++实现四则运算器(无括号)
  10. linux内核PID管理
  11. C# 无法识别的转义序列
  12. 超大文本文件怎么打开(使用Hex Editor)
  13. cat3 utp是不是网线_CAT网线知识
  14. 红外感应器+arduino+processing+flash 实现麦克风吹波波效果
  15. IDEA社区版下载与安装详细教程
  16. IOS swift 清理缓存
  17. 数据结构---C++版
  18. 通俗易懂解释Docker是什么
  19. CMD权限不够怎么办
  20. 鸿蒙荣耀magic2,荣耀Magic2亮相:近100%屏占比+麒麟980+40W超级快充

热门文章

  1. web图片铺满网页_web单页面实现多个echarts图表铺满整个div(柱状图,折线图,饼形图……)...
  2. python运算符括号_Python合集之Python运算符(四)
  3. python两列字符串合并_python两列字符串如何合并?
  4. 百度前端技术学院html任务,重回百度前端技术学院第一天 HTML复习
  5. c++ map通过值找键与通过键找值得方法(全)
  6. 信息系统项目管理师-知识产权、项目收尾、标准规范核心知识点思维脑图
  7. 信息系统项目管理师-项目采购管理核心知识点思维脑图
  8. SpringBoot中实现CommandLineRunner接口在项目启动后立即执行某方法
  9. Android中实现调用摄像头拍照并显示在ImageView中
  10. Word中轻松插入本地视频