python3 -m pip:正在向主机“pypi.org”发出未经验证的 HTTPS 请求

问题描述 投票:0回答:1

我正在跑步

python3
:

python3 --version
Python 3.9.2

我打算更新本地

pip
软件包,为此我首先检查了哪些已过时:

python3 -m pip list --outdated

这为每个特定的包生成了一条警告消息(它们都是相同的,因此我仅显示一个示例):

/usr/share/python-wheels/urllib3-1.26.5-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/usr/share/python-wheels/urllib3-1.26.5-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/usr/share/python-wheels/urllib3-1.26.5-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/usr/share/python-wheels/urllib3-1.26.5-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/usr/share/python-wheels/urllib3-1.26.5-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

最后生成了一个软件包列表,但我想了解为什么

pip
显示此行为。

我检查了警告中的推荐页面,但它没有为我的案例提供任何有用的信息,因为它专注于直接使用

urllib3
requests
包的编程用例。

有人建议忽略此警告(及其带来的所有危险),并将命令行参数传递给

pip

我不知道为什么这个警告开始出现。

python pip urllib3
1个回答
0
投票

我不确定到底是什么问题,但升级后就解决了

pip

旧版本:

python3 -m pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

然后我升级了

pip
,如下:

python3 -m pip install -U  pip --upgrade

python3 -m pip --version

pip 23.2.1 from /home/myuser/.local/lib/python3.9/site-packages/pip (python 3.9)

升级后

pip
,警告消失了。

© www.soinside.com 2019 - 2024. All rights reserved.