1、问题

python安装完毕后,提示找不到ssl模块:
[root@localhost ~]# python3
Python 3.6. (default, Jun , ::)
[GCC 4.1. (Red Hat 4.1.-)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line , in <module>
File "/usr/local/python27/lib/python2.7/ssl.py", line , in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>

2、解决

修改Python-3.6.5文件夹中的/Moudes/Setup.dict

# 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 #去除该行注释(备注)

重新编译

make
sudo make install

再进入python3交互模式,import ssl就可以了。

ubuntu下安装python3.6.5导入ssl模块失败的更多相关文章

  1. Python3中无法导入ssl模块的解决办法

    这个问题,已经困扰我好几天了,本萌新刚开始接触python,想爬取几个网页试试,发现urllib无法识别https,百度后才知道要导入ssl模块,可是发现又报错了. 本人实在无法理解为什么会报错,因为 ...

  2. Ubuntu下安装Python3.4

    转自:http://blog.sina.com.cn/s/blog_7cdaf8b60102vf2b.html 1. 通过命令行安装Python3.4,执行命令:sudo apt-get instal ...

  3. ubuntu下安装Python3

    到www.python.org网站下载python3.3.2 Gzipped source tar ball (3.3.2) (sig), ~ 16 MB 解压tar vxzf Python3.3.2 ...

  4. Ubuntu下安装Python3.4及用python编译py文件

    1.安装python 3.4程序 sudo apt-get install python3.4 2.python 3.4是被默认安装在/usr/local/lib/python3.4,删除默认pyth ...

  5. centOS安装python3 以及解决 导入ssl包出错的问题

    参考: https://www.cnblogs.com/mqxs/p/9103031.html https://www.cnblogs.com/cerutodog/p/9908574.html 确认环 ...

  6. Ubuntu下安装Python3.6并在终端输入Python就能显示Python3.6

      Ubuntu17.04自带Python2.7与Python3.5.3的版本,由于Python2与Python3有着一些差距可能需要安装更新Python3的版本,并且切换默认的Python解释器. ...

  7. Ubuntu下安装Python3(与旧Python2版本共存)

    官网下载Python3的源码 进行配置,在源码目录运行如下命令. ./configure --prefix=/usr/local/python3 --enable-shared 进行编译,在源码目录运 ...

  8. ubuntu下安装python3及常用爬虫库命令

    爬虫常用库安装:

  9. Ubuntu 18.04 Python3.6.6导入wx模块报Gtk-Message : 17:06:05.797 :Failed to load module "canberra-gtk-module"

    解决办法: root@sishen:~# apt-get install libcanberra-gtk-module

随机推荐

  1. PTA编程总结一

    7-1 币值转换 (20 分) 输入一个整数(位数不超过9位)代表一个人民币值(单位为元),请转换成财务要求的大写中文格式.如23108元,转换后变成“贰万叁仟壹百零捌”元.为了简化输出,用小写英文字 ...

  2. 1、安装Scrapy

    一.网址:https://doc.scrapy.org/en/latest/intro/install.html 二.安装过程中出现"cl.exe"找不到的错误,解决方法:http ...

  3. SVN重命名后,不允许提交

    在vs中对文件名重命名后,导致不能提交 解决: 在源码根目录下提交源码,提交完毕后,再使用如下菜单对需要命名的单个文件进行重命名,重命名完毕后,在源码根目录下提交源码即可

  4. Spring的Aop理解

    主要作用:解决代码复用,避免重复性编写代码. 比较典型的场景:日志打印,权限验证,事务处理 参考网址为:http://moon-walker.iteye.com/blog/2381532 spring ...

  5. 浅谈移动端设备标识码:DeviceID、IMEI、IDFA、UDID和UUID -费元星

    在公司做数据分析的时候,发现NA端有很多ID,所有来系统的理解一下,有问题大家多指出   [心路历程] 最近刚好在思考工作中统计数据所用的标识码产生的数据误差到底有多大,借此机会几番搜索资料+请教大神 ...

  6. 2018.03.29 python-pandas transform/apply 的使用

    #一般化的groupby方法:apply df = pd.DataFrame({'data1':np.random.rand(5), 'data2':np.random.rand(5), 'key1' ...

  7. 【ABAP系列】SAP ABAP 控制ALV单元格编辑后获取新的数值

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 控制ALV单元 ...

  8. Scratch少儿编程系列:(九)音乐高级技巧

    一.程序说明 本程序用来演奏音乐,相对于“Scratch少儿编程系列:(八)演奏简单音乐”而言,本节介绍的方法适用于复杂点的音乐. 二.程序流程图 为了更直观的描述上述过程,采用流程图的方式将猜数字的 ...

  9. BCD与ASCII码互转-C语言实现

    /*BCD 与 ASCII码转换*/ /******************************************************************* 函数名:  asc2bc ...

  10. ant buid.xml 模板

    <?xml version="1.0" encoding="UTF-8"?> <project name="ant" de ...