pip不起作用,TTPSConnectionPool(host ='pypi.org',port = 443):超出最大重试次数

时间:2018-06-13 11:50:04

标签: python pip python-3.6

我试试这个:

pip install numpy

我明白了:

The directory '/home/teoman/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
The directory '/home/teoman/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting numpy
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
  Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

我几乎尝试了this question的所有内容,即使问题实际上是不同的(我现在注意到了)有什么问题?

1 个答案:

答案 0 :(得分:1)

pip install --index https://pypi.mirrors.ustc.edu.cn/simple numpy

您可以使用'--index'指定python lib镜像

对于中国地区用户,以下是一些镜像: 找到了一些国内合理如下:

阿里云http://mirrors.aliyun.com/pypi/simple/

中国科技大学https://pypi.mirrors.ustc.edu.cn/simple/

douban http://pypi.douban.com/simple

Python官方https://pypi.python.org/simple

v2ex http://pypi.v2ex.com/simple

中国科学院http://pypi.mirrors.opencas.cn/simple/

清华大学https://pypi.tuna.tsinghua.edu.cn/simple/