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. vscode Vue格式化HTML标签换行问题

    解决方法:在设置里面直接贴上代码: "vetur.format.defaultFormatter.html": "js-beautify-html", &quo ...

  2. 关于SQL注入的问题以及解决方法

    1.关于SQL注入 什么是SQL注入: 由于jdbc程序在执行的过程中sql语句在拼装时使用了由页面传入参数,如果用户恶意传入一些sql中的特殊关键字,会导致sql语句意义发生变化,这种攻击方式就叫做 ...

  3. spring boot官方配置

    #BANNER banner.charset = UTF-8 #横幅文件编码.banner.location = classpath:banner.txt #横幅文件位置.banner.image.l ...

  4. mysql数据库连接错误10060

    今天在使用mysql数据库的时候,出现错误ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10060) 我在网上一顿 ...

  5. 查看dll中的函数(方法)

    https://jingyan.baidu.com/article/5553fa82b953b365a23934b7.html 查看dll中的函数(方法) 听语音 | 浏览:2004 | 更新:201 ...

  6. windows 使用Docker Desktop 使用国内镜像

    ===新增一些比较给力的镜像=== 1.中科大镜像加速地址 https://docker.mirrors.ustc.edu.cn 2.阿里云镜像服务 ========= 原本在配置项中添加了:国内镜像 ...

  7. Dubbo分布式服务框架入门(附工程)

    要想了解Dubbo是什么,我们不防先了解它有什么用. 使用场景:比如我想开发一个网上商城项目,这个网上商城呢,比较复杂,分为pc端web管理后台,微信端销售公众号,那么我们分成四个项目,pc端网站,微 ...

  8. ARTS-3

    ARTS的初衷 Algorithm:主要是为了编程训练和学习.每周至少做一个 leetcode 的算法题(先从Easy开始,然后再Medium,最后才Hard).进行编程训练,如果不训练你看再多的算法 ...

  9. spring(二) JDBC

    一.配置 bean.xml , 链接数据库. c3p0数据库连接池 <?xml version="1.0" encoding="UTF-8"?> & ...

  10. Scratch少儿编程系列:(二)界面介绍及相关概念

    本系列后续所有Scratch的讲解均基于2.0版本介绍.系统启动后,界面如下: Scratch主要包括6个区域: 1. 菜单:新建.打开.保存 Scratch文件,2.0版本文件后缀名为 .sb2 2 ...