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
我阅读了类似的问题,并检查了我没有设置代理,并且我的防火墙被禁用。
我该怎么办?
解决方案
" sudo pip install --default-timeout=100 future
"
如何用 pip 解决 ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443)?
sudo 可能需要也可能不需要。使用 sudo 时要小心。
推荐阅读
- javascript - 从具有不同 id 的 div 中删除指定的主元素
- spring-boot - Spring引导多个上下文 - 一个用于公共错误
- c# - 如何应用具有多个选项的过滤器
- firebase-authentication - Firebase 的 Google 身份验证用户对象返回带有 404 响应的配置文件路径
- arrays - 在 node.js 中返回未定义的 JSON 数组值
- node.js - NodeJS/React/Firestore - 在状态中存储查询结果
- oauth-2.0 - 无法验证从 Azure AD 获得的访问令牌签名以保护 Web API
- java - Spring Boot 中的非英语字符串
- php - Symfony 4.2 中未找到简单总线 event_subscriber 服务
- c# - 在 JOIN 中使用 dapper