pip 为什么无法使用 https 源?
先贴 log
D:\Personal\WP\Desktop\pip-19.1.1>python --versionPython 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年发布的。
回答:
复现了你的问题,
用pip install requests --force-reinstall
命令可以下载成功。
以上是 pip 为什么无法使用 https 源? 的全部内容, 来源链接: utcz.com/p/938646.html