pip 为什么无法使用 https 源?

先贴 log

D:\Personal\WP\Desktop\pip-19.1.1>python --version
Python 3.4.4

D:\Personal\WP\Desktop\pip-19.1.1>pip -V
pip 19.1.1 from C:\Python34\lib\site-packages\pip-19.1.1-py3.4.egg\pip (python 3.4)

D:\Personal\WP\Desktop\pip-19.1.1>pip list
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
Package    Version
---------- -------
pip        19.1.1
setuptools 18.2

D:\Personal\WP\Desktop\pip-19.1.1>pip install -vvv requests
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: D:\Personal\WP\Temp\pip-ephem-wheel-cache-kqoqe5ea
Created temporary directory: D:\Personal\WP\Temp\pip-req-tracker-zrzjgkxy
Created requirements tracker 'D:\\Personal\\WP\\Temp\\pip-req-tracker-zrzjgkxy'
Created temporary directory: D:\Personal\WP\Temp\pip-install-mrfwtanx
Collecting requests
  1 location(s) to search for versions of requests:
  * https://pypi.org/simple/requests/
  Getting page https://pypi.org/simple/requests/
  Looking up "https://pypi.org/simple/requests/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443

D:\Personal\WP\Desktop\pip-19.1.1>

可以看到 log 在 Starting new HTTPS connection (1): pypi.org:443 这句后直接退出了,也没有报错信息。但是把源换成 http:// 开头的,就正常了,所有关于 https 的操作都是这个结果(install, list -o 之类的)。

我尝试过重装 python,换过阿里云,中科大,清华的源,只要是 https 的源都会直接退出。这是为什么呢?有没有人遇到过?谢谢大家!

我的OS:Windows 10 1909 x64

更新提问 2022.10.25:
我重装系统测试了,发现纯净的原版系统(包括 1903 和 1909)也不行,用了 --force-reinstall 也不行,直接在 collecting 之后自动退出了。可能是 3.4 版本的 python 太老了,不兼容我的主板吧,谢谢了。我的主板是 ASROCK-H510M,2021年发布的。

阅读 2.7k
1 个回答

复现了你的问题,
pip install requests --force-reinstall命令可以下载成功。
image.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏