简体   繁体   中英

How can I install a private module with public dependencies in pip?

I've found a few answers that relate to dependency_links but they unfortunately have yet to work for me. I'm writing a python module. It's stored in a private pypi repo, and relies on a few dependencies stored both in the same private repo and the public pypi repository :

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"
])

I store mymodule in my private repository, thus I try to install it:

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

That works just fine, but fails to find kazoo , which is a public library. Thus I try the -f flag:

$ 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)

How can I download dependencies from the public pypi repository while simultaneously installing my module from my private one?

Add --extra-index-url https://pypi.python.org/simple to your command. It will first look at http://my.private.repo/eggs/ and then at https://pypi.python.org/simple .

Check out more information at https://pip.pypa.io/en/stable/cli/pip_wheel/#cmdoption-extra-index-url

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM