如何从私有 Pypi 存储库将 python 软件包安装到 google Colab?

How can I install a python package to google Colab from a private Pypi repository?

我的公司开发了 python 包并将它们托管在私有 Pypi 存储库中。我希望在 Google Colab 笔记本上安装这些包。

如果它们在 public Pypi 存储库上,这将有效:

!pip3 install --index-url=https://pypi.spotify.net/spotify/production confidence

但是,它会导致此错误:

Looking in indexes: https://pypi.spotify.net/spotify/production
Collecting confidence
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f9e601748>, 'Connection to pypi.spotify.net timed out. (connect timeout=15)')': /spotify/production/confidence/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f9e601588>, 'Connection to pypi.spotify.net timed out. (connect timeout=15)')': /spotify/production/confidence/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f9e6015f8>, 'Connection to pypi.spotify.net timed out. (connect timeout=15)')': /spotify/production/confidence/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f9e601390>, 'Connection to pypi.spotify.net timed out. (connect timeout=15)')': /spotify/production/confidence/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0f9e6012e8>, 'Connection to pypi.spotify.net timed out. (connect timeout=15)')': /spotify/production/confidence/
  ERROR: Could not find a version that satisfies the requirement confidence (from versions: none)
ERROR: No matching distribution found for confidence

我怀疑这是因为 google Colab 是托管笔记本。这意味着它不是通过我的工作 wifi 连接到 Pypi,而是从 google 服务器连接到 Pypi。

您需要: