Python安装后找不到ssl模块怎么办,如何处理
Admin 2022-07-12 群英技术资讯 817 次浏览
python安装完毕后,提示找不到ssl模块:
[www@pythontab.com ~]$ python Python 2.7.15 (default, Oct 23 2018, 18:08:43) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] 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 >>>
[www@pythontab.com ~]$ rpm -aq|grep openssl openssl-0.9.8e-20.el5 openssl-0.9.8e-20.el5 [www@pythontab.com ~]$
[www@pythontab.com ~]$ yum install openssl-devel -y #查看安装结果 [www@pythontab.com ~]$ rpm -aq|grep openssl openssl-devel-1.0.1e-57.el6.x86_64 openssl-1.0.1e-57.el6.x86_64
修改Setup文件
vi /src/Python-2.7.15/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
进入源码目录,重新编译安装
[www@pythontab.com ~]$ cd /src/Python-2.7.15/ [www@pythontab.com ~]$ make [www@pythontab.com ~]$ make install
5. 测试,已可正常使用。
[www@pythontab.com ~]$ python Python 2.7.15 (default, Oct 23 2018, 19:08:43) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
matplotlib内置了众多预定义的颜色映射表,使用这些颜色映射表可以为用户提供更多的颜色建议,为用户节省大量的开发时间。pyplot模块中提供了colormaps()函数用于查看所有可用的颜色映射表,示例代码及运行结果如下。
ROI区域又叫感兴趣区域。在机器视觉、图像处理中,从被处理的图像以方框、圆、椭圆、不规则多边形等方式勾勒出需要处理的区域,称为感兴趣区域,ROI。本文主要为大家介绍如何通过Python+OpenCV提取ROI区域,需要的朋友可以了解一下
这篇文章主要给大家介绍了关于如何利用Python开发一个简单的猜数字游戏的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用Python具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
python如何求两个向量夹角?如下图所示我们想要求两个向量的顺时针夹角,那么我们要怎么样做呢?有什么方法?这篇文件就给大家介绍 python如何计算两向量的顺时针夹角,感兴趣的朋友就继续看吧。
这篇文章主要介绍了Python 统计数据集标签的类别及数目操作,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
成为群英会员,开启智能安全云计算之旅
立即注册Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008