python - python3.8 virtualenv pip没有升级
问题描述
在运行以下命令
pip install --upgrade pip
即使我无法安装任何其他软件包,它也会显示以下错误,因为它说先升级 pip。
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: 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/pip/
WARNING: 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/pip/
WARNING: 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/pip/
WARNING: 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/pip/
WARNING: 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/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Requirement already up-to-date: pip in ./environments/mjshare_env/lib/python3.8/site-packages (19.3.1)
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
如果我跑
pip list
我有以下包裹
Package Version
---------- -------
pip 19.3.1
setuptools 42.0.2
wheel 0.33.6
解决方案
问题不在于 pip 的版本,而在于 ssl。您安装的 python 版本没有 ssl 模块,如果您在没有安装 libssl-dev 头文件的情况下编译 python,就会出现这种情况。(或者你下载的版本就是这样制作的)。
推荐阅读
- kivy - remove_widget kivy 不按名称删除
- spring-boot - CrudRepository 上的错误。白标错误页面
- android - Flutter 中的 Image_picker 依赖项不允许我使用错误消息编译我的应用程序
- powershell - Sharepoint 时区更改 Powershell
- reactjs - React chartjs - 图表保持为空,除非图例被点击两次
- javascript - 如何使用 Javascript 验证 HTML 表单
- typescript - 是否可以根据特定泛型类型参数的存在动态设置泛型函数中函数参数的类型?
- typescript - TypeScript 单元测试不能在模块外使用 import 语句
- swift - 如何在swift 5中更新标记而不重新加载谷歌地图
- android - 应用程序进入后台后自动销毁子片段 - Android