ubuntu下安装python3.6.5导入ssl模块失败
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模块失败的更多相关文章
- Python3中无法导入ssl模块的解决办法
这个问题,已经困扰我好几天了,本萌新刚开始接触python,想爬取几个网页试试,发现urllib无法识别https,百度后才知道要导入ssl模块,可是发现又报错了. 本人实在无法理解为什么会报错,因为 ...
- Ubuntu下安装Python3.4
转自:http://blog.sina.com.cn/s/blog_7cdaf8b60102vf2b.html 1. 通过命令行安装Python3.4,执行命令:sudo apt-get instal ...
- ubuntu下安装Python3
到www.python.org网站下载python3.3.2 Gzipped source tar ball (3.3.2) (sig), ~ 16 MB 解压tar vxzf Python3.3.2 ...
- 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 ...
- centOS安装python3 以及解决 导入ssl包出错的问题
参考: https://www.cnblogs.com/mqxs/p/9103031.html https://www.cnblogs.com/cerutodog/p/9908574.html 确认环 ...
- Ubuntu下安装Python3.6并在终端输入Python就能显示Python3.6
Ubuntu17.04自带Python2.7与Python3.5.3的版本,由于Python2与Python3有着一些差距可能需要安装更新Python3的版本,并且切换默认的Python解释器. ...
- Ubuntu下安装Python3(与旧Python2版本共存)
官网下载Python3的源码 进行配置,在源码目录运行如下命令. ./configure --prefix=/usr/local/python3 --enable-shared 进行编译,在源码目录运 ...
- ubuntu下安装python3及常用爬虫库命令
爬虫常用库安装:
- 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
随机推荐
- centos7没有IP地址
查看网卡 ip addr查看网卡 我截图中有ip,是因为我已经设置过了. eth0是对外的网卡,我们接下来设置这个网卡,你的网卡名字可能和我的不一样. 修改网卡 修改/etc/sysconfig/ne ...
- CentOS7服务器配置
CentOS7服务器配置 1.更换yum软件源 下载阿里源 cd /etc/yum.repos.d sudo wget -nc http://mirrors.aliyun.com/repo/Cento ...
- http-server 建立 HTTPS 服务
1. 创建证书 进入要建立 HTTPS 服务的目录 openssl genrsa -out key.pem 1024 openssl req -new -key key.pem -out csr.pe ...
- object Object {} any unknown
object: 除了primitive(boolean null number string undefined bigint symbol)的类型 Object: Object和any很像 ,Obj ...
- lazarus 给应用程序创建 配置文件哈哈
lazarus 给应用程序创建 配置文件哈哈procedure TForm1.Button2Click(Sender: TObject);beginForceDirectoriesUTF8(GetAp ...
- sql type subtype 统计
select * from testtable; type subtype value a sa 1b sb 1a sb errorb sa errora sb 1b sb 1c sa errorc ...
- 2019暑假第二周(hadoop在个人电脑上的搭建)
一,Hadoop和NoSQL数据库的学习,大多需要Linux环境. 搭建Linux环境可以分为两种方式: (1)在电脑上安装双操作系统,即同时安装Linux和Windows操作系统,在电脑启动的时候, ...
- Servlet生命周期 Servlet获取配置信息 ServletContext
一.Servlet生命周期 实例化 ——> 初始化 ——> 服务 ——> 销毁 出生:(实例化 然后 初始化)tomcat第一次访问,Servlet就出生(默认情况下) 活着:( ...
- 【MM系列】SAP 的账期分析和操作
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP 的账期分析和操作 前言部 ...
- 1.parrot os 3.5-----nmap-----katoolin--zenmap
源:https://www.youtube.com/watch?v=LpM1KooILRc&list=PLBf0hzazHTGOEuhPQSnq-Ej8jRyXxfYvl&index= ...