3

我找到了一些与dependency_links 相关的答案,但不幸的是它们还没有为我工作。我正在编写一个 python 模块。它存储在私有 pypi 存储库中,并依赖于存储在同一个私有存储库和公共 pypi 存储库中的一些依赖项:

setup(
# some other setup
name = 'mymodule',
install_requires = [
    'kazoo',
    'privateDependencyA',
    'privateDependencyB'
],
dependency_links = [
    "http://my.private.repo/eggs/#privateDependencyA",
    "http://my.private.repo/eggs/#privateDependencyB"
])

我存储mymodule在我的私人存储库中,因此我尝试安装它:

pip install -i http://my.private.repo/eggs/ mymodule

这工作得很好,但找不到kazoo公共图书馆。因此我尝试了-f标志:

$ pip install -i http://my.private.repo/eggs/ -f http://pypi.python.org/ mymodule                                                                                                                                                                                                                                      
Downloading/unpacking mymodule
  Downloading mymoudle-<version>.tar.gz (unknown size): 3.1kB downloaded
  Running setup.py egg_info for package mymodule

Downloading/unpacking kazoo (from mymodule)
  Could not find any downloads that satisfy the requirement kazoo (from mymodule)

Downloading/unpacking kazoo (from mymodule)
  Could not find any downloads that satisfy the requirement kazoo (from mymodule)

如何从公共 pypi 存储库下载依赖项,同时从我的私人存储库安装我的模块?

4

1 回答 1

5

添加--extra-index-url https://pypi.python.org/simple到您的命令中。它将首先查看http://my.private.repo/eggs/,然后查看https://pypi.python.org/simple

在https://pip.pypa.io/en/stable/cli/pip_wheel/#cmdoption-extra-index-url查看更多信息

于 2013-01-13T18:45:18.397 回答