首页 > 解决方案 > 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

我阅读了类似的问题,并检查了我没有设置代理,并且我的防火墙被禁用。

我该怎么办?

标签: pythonlinuxpip

解决方案


" sudo pip install --default-timeout=100 future"

如何用 pip 解决 ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443)?

sudo 可能需要也可能不需要。使用 sudo 时要小心。

另: 使用 Pip3 安装的问题


推荐阅读