linux服务器pip无法安装模块

时间:2020-02-04 06:42:02

标签: python linux pip

我的pip -V返回:pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

python3 -V返回:Python 3.6.9

当我尝试使用pip安装模块时,出现以下错误:

Collecting Django==2.2.1
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/`

>Could not find a version that satisfies the requirement Django==2.2.1 (from versions: )

>No matching distribution found for Django==2.2.1

我读过类似的问题,并检查了我是否没有代理集,并且禁用了防火墙。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

sudo pip install --default-timeout=100 future

How to solve ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443) with pip?

sudo可能是必需的,也可能不是必需的。使用sudo时要小心。

还:Issues Installing with Pip3