urllib2.URLError: <urlopen error unknown url type: https>
来源:互联网 发布:cf手游版刷枪软件下载 编辑:程序博客网 时间:2024/06/07 23:11
升级 python 版本后,使用 python 可能会出现以下报错
urllib2.URLError: <urlopen error unknown url type: https>
因为编译 python 的时候没有把 ssl模块 编译进去,只需修改 Modules/Setup文件 重新编译安装即可。
进入python安装包,找到Setup文件,用 vi 打开
cd Python-2.7.3/Modulesvi Setup
找到
# 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
把前面的 # 号去掉,修改为
# 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
保存退出,重新编译安装
./configure --prefix=/usr/local/python2.7 make && make install
完成,漂亮~
1 0
- urllib2.URLError: <urlopen error unknown url type: https>
- urllib2.URLError: <urlopen error unknown url type: https>
- urllib2.URLErroe:<urlopen error unknown url type : https>
- urllib2.URLError<urlopen error no host given>
- URLError: <urlopen error [Errno 10061]<urllib2 报错问题>
- URLError: <urlopen error [Errno 10051] >
- [goagent]urllib2.URLError: <urlopen error [Errno timed out] counld not connect to 'appeng ine.google
- urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
- scrapy URLerror:<urlopen error [Error 10051]> 问题
- 【Python】 URLError: <urlopen error timed out> 错误
- appium genymotion URLError: <urlopen error [Errno 10061] >
- 解决爬虫错误:urllib.error.URLError: <urlopen error [WinError 10060]
- Python报错: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
- Repo Init Fatal: error unknown url type
- python3.5 URLError: <urlopen error [Errno 10061]报错解决方法
- 用easy_install時出現unknown url type: https问题
- urllib2.urlopen(url).read() vs requests.get(url).content
- 【转】Python urllib2.urlopen打开中文url的编码处理
- 在Activiti中使用UUID作为主键生成策略
- gitHUb上边一个效果很好的仪表盘Library
- OpenCV学习12
- rgba和 opacity的异同
- 关于百度地图接入项目的几点
- urllib2.URLError: <urlopen error unknown url type: https>
- Android学习笔记----广播接收者
- JSP及JAVA开发环境的搭建
- IOS学习 Other linker flags和OTHER_LDFLAGS
- AIX 6.1 异步 I/O 的 配置与性能评估
- 自定义viewPager下面的导航按钮
- iOS uinavigationbar的一些属性设置
- hadoop学习之二:mac下hadoop+eclipse环境搭建
- Android L中水波纹点击效果的实现