ubuntu16.04;python3.7
2018/09/19
ssl
import urllib.requset
运行里面urlopen报错:(这可是我第一个小爬虫程序,你就报错???)
…
#前面报了一大堆错记不住了。。。只有下面这句
urllib.error.URLError: <urlopen error unknown url type: https>
ok,接下来就是解决了。
查询得知:python内置的urllib模块不支持https协议,编译安装python之前没有编译安装类似于openssl这样的SSL库,以至于python不支持SSL
有人说进入python->Module->Setup 去掉四行关于ssl的注释再编译,没什么卵用。。。
直接
apt-get install libssl-dev
cd /usr/bin/Python-3.7.0
#进入你的python连接到的python文件夹里面
.configure
make && make altinstall
#done