ubuntu 更新python2.7 ssl 错误解决

原创
2016/05/19 16:56
阅读数 925

我是按照下面的博客来升级Python2.7.6 - Python2.7.9(其他版本类似) update python

在SetupTools 这一步报错了:

wget https://bootstrap.pypa.io/ez_setup.py -O - | /usr/local/lib/python2.7.9/bin/python

error stack:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/urllib/request.py", line 178, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/local/lib/python3.4/urllib/request.py", line 153, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.4/urllib/request.py", line 461, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.4/urllib/request.py", line 571, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.4/urllib/request.py", line 493, in error
    result = self._call_chain(*args)
  File "/usr/local/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.4/urllib/request.py", line 676, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/lib/python3.4/urllib/request.py", line 455, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.4/urllib/request.py", line 478, in _open
    'unknown_open', req)
  File "/usr/local/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.4/urllib/request.py", line 1257, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>

错误原因:

原因

最快解决办法

若已经安装了 openssl ,则再安装一下 libssl-dev(ubuntu 下不同于 Centos(openssl-devel))

apt-get install libssl-dev 然后重新 make,make install

若没安装,请查看下面的方法: 检测和解决办法

展开阅读全文
打赏
2
1 收藏
分享
加载中
更多评论
打赏
0 评论
1 收藏
2
分享
返回顶部
顶部