首页 > 解决方案 > 从哪些存储库安装 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 页面中的包,还是搜索两者?

预先感谢您的帮助。

标签: pythonpip

解决方案


出现网络连接,稍后您可以尝试以下操作:

pip install sistr-cmd-查看和 之间的区别_了解更多信息,请查看此处


推荐阅读