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
随机推荐
- 【每日一包0006】dedupe
github地址:https://github.com/ABCDdouyae... dedupe 对数组进行去重,也可以自定义去重(比如要求数组的每一个对象的某个属性不重复) 文档地址:https:/ ...
- centos64位编译32位程序
test.c #include <stdio.h> int main() { printf("sizeof long is %d\n",sizeof(long)); ; ...
- OperationCenter Docker运行环境及其依赖启动脚本
1.Portainer docker rm -f portainer docker run -d -p : --name portainer --restart always portainer/po ...
- C# WPF 漂亮的loading 效果
<UserControl x:Class="TestLoadPic.Loading" xmlns="http://schemas.microsoft.com/win ...
- 你的第一个Quartz程序
package org.quartz.examples.example1; import java.util.Date; import org.slf4j.Logger; import org.slf ...
- HTTP学习记录:三、状态码
学习资源主要为:@小坦克HTTP相关博客 常见的HTTP状态码: 200--请求成功: 302--重定向: 304--Not Modified:表示上次的文档已经被缓存了,还可以继续使用: 400-- ...
- Golang http post error : http: ContentLength=355 with Body length 0
参考:https://stackoverflow.com/questions/31337891/net-http-http-contentlength-222-with-body-length-0 问 ...
- NW.js
1.package.json属性说明: ——window窗口外观常用属性包括: title : 字符串,设置默认 title width/height : 主窗口的大小 toolbar : bool ...
- 6.824 Lab 2: Raft 2B
Part 2B We want Raft to keep a consistent, replicated log of operations. A call to Start() at the le ...
- python 并发编程 多进程 模拟抢票
抢票是并发执行 多个进程可以访问同一个文件 多个进程共享同一文件,我们可以把文件当数据库,用多个进程模拟多个人执行抢票任务 db.txt {"count": 1} 并发运行,效率高 ...