python - 从哪些存储库安装 pip 包?
问题描述
我需要使用 pip 下载一个包。我跑pip install <package>
了,但出现以下错误:
[user@server ~]$ pip install sistr_cmd
Collecting sistr_cmd
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f518ee0cd90>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/sistr-cmd/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f518ee0c290>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/sistr-cmd/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f518ee0c510>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/sistr-cmd/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f518ee0cf10>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/sistr-cmd/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f518ee0c190>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/sistr-cmd/
Could not find a version that satisfies the requirement sistr_cmd (from versions: )
No matching distribution found for sistr_cmd
我确认问题的根源是网络阻止了大多数站点,因为我在代理后面工作(组织要求)。为了允许这些下载,我需要编译下载源的 url 列表并将其发送给网络管理员以解除阻止。
根据 pip 文档(在 pip Wikipedia 文章中简要引用和解释),“许多包可以在包及其依赖项的默认源 - Python 包索引 (PyPI) 中找到”,所以我去了 Biopython 的 PyPI 页面并找到了 github 存储库和包所需的依赖项。PyPI 页面上还有下载链接,我想确保所有下载源都被允许。pip 从包的原始源安装也是如此( github 存储库或托管原始包的任何地方),下载中列出的 PyPI 页面中的包,还是搜索两者?
预先感谢您的帮助。
解决方案
出现网络连接,稍后您可以尝试以下操作:
pip install sistr-cmd
-
查看和
之间的区别_
了解更多信息,请查看此处
推荐阅读
- javascript - vue 找不到 vuetify v-img 元素的动态源
- java - 为什么要使用 Consumer 和 Producer 而不是普通的 getter/setter?
- c# - 使用 DI 在 Startup.cs 中访问 NPGSQL
- shell - 在 shell 脚本中使用 "set --" 会导致 "bad number"
- regex - 我无法从未使用的运算符中删除零
- python - 在 Python 中使用时间戳重命名将文件移动到子目录
- java - jdk版本如何决定——Oracle发布周期更短
- groovy - 在groovy中映射,如何从键中获取值?
- php - 我可以从 mysql 表中获取值并将其设置为变量吗?
- qt - Qt Installer Framework - 防止安装在非空文件夹中