5

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?

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

1 Comment

This introduces a security vulnerability stackoverflow.com/questions/66242072/… (!!!) Always specify explicit versions of internal and external packages in requirements.txt. Also could you confirm your source for this? It will first look at http://my.private.repo/eggs/ and then at https://pypi.python.org/simple. Seems like that's not always the case.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.