gpt4 book ai didi

使用 wheel 文件的 python Pip 安装不起作用

转载 作者:行者123 更新时间:2023-11-28 22:12:55 28 4
gpt4 key购买 nike

由于网络限制和证书错误,我无法正常使用 pip 安装 python 库。

所以我尝试下载 .whl 并手动安装库。但是它也因同样的错误而失败。

C:\python3.7>python -m pip install requests-2.21.0-py2.py3-none-any.whl
Processing c:\python3.7\requests-2.21.0-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests==2.21.0)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x039C3D90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567350>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567D10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567FD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04545F70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Could not find a version that satisfies the requirement idna<2.9,>=2.5 (from requests==2.21.0) (from versions: )
No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0)

按照建议尝试了 --use-wheel 选项,但不起作用。看起来 pip 很旧,但是我什至无法升级 pip,因为它还需要一个合适的工作网络。这是一个 catch22 的情况。

C:\python3.7>python -m pip install --use-wheel requests-2.21.0-py2.py3-none-any.whl

Usage:
C:\python3.7\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
C:\python3.7\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
C:\python3.7\python.exe -m pip install [options] [-e] <vcs project url> ...
C:\python3.7\python.exe -m pip install [options] [-e] <local project path> ...
C:\python3.7\python.exe -m pip install [options] <archive url/path> ...

no such option: --use-wheel

如何手动安装库?

最佳答案

问题不在于你的轮子,它能工作。但是这一行很重要:

No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0)

因此您还需要下载 idna。可能还有其他依赖项。

$ python -m pip show requests
Requires: urllib3, chardet, idna, certifi

所以您还需要这四个。老实说,我认为您尝试手动完成这一切会遇到很多困难。依赖关系树可能有几层深。

关于使用 wheel 文件的 python Pip 安装不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54416813/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com