1

I am the package maintainer of a package that has dependencies to packages hosted in our own pip repository.

I want these packages to also be installed when doing pip install mypackage.

setup(
  name='mypackage',
  version='1.1.2',
  description='My awesome package',
  dependency_links=[
    'http://www.myrepo.se/packages/mydep1/',
    'http://www.myrepo.se/packages/mydep2/'
  ]
  install_requires=[
    'mydep1==1.0.0',
    'mydep2==5.6.7'
  ]
)

The folder structure in the repo is the following:

packages/
  mydep1/
    mydep1-1.0.0.tar.gz
  mydep2/
    mydep2-5.5.1.tar.gz
    mydep2-5.6.7.tar.gz

All according to the accepted answer on this question Using an extra python package index url with setup.py

However, this does not work. I get the error:

Collecting mydep1 (from mypackage==1.1.2)
  Could not find a version that satisfies the requirement mydep1 (from mypackage==1.1.2) (from versions: )
No matching distribution found for mydep1 (from mypackage==1.1.2)

When I have added an extra index url to my requirements.txt before doing it this was I had to add the url as a trusted host. Is that relevant? Also I am using python 3.5.3

EDIT: I activated verbose output from pip and it is not even trying to find the package from my repo.

1 location(s) to search for versions of mydep1:
  * https://pypi.python.org/simple/mydep1/
  Getting page https://pypi.python.org/simple/mydep1/
  ...
2
  • Possible duplicate of pip ignores dependency_links in setup.py Commented Oct 10, 2018 at 18:51
  • Yes. It is a duplicate in that the solution was the same. It is also not a duplicate since I was trying to install from a custom pypi repo and he was trying to install from GitHub. Also, even though I searched I didn't find it until after I posted my question :) Commented Oct 11, 2018 at 8:57

1 Answer 1

0

It seems pip is not processing the dependency links unless you explicitly tell it to (which unfortunately means that all consumers of mypackage must know to do so).

pip install --process-dependency-links mypackage

Since mypackage is also hosted by the same repository it means that a consumers requirements.txt must look like

--trusted-host http://www.myrepo.se/
--extra-index-url http://www.myrepo.se/packages
--process-dependency-links

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

2 Comments

The --process-dependency-links option is no longer supported in pip v 19.0.3. I have exactly the issue stated here, but without this option am unsure how to proceed?
@Gabriel, use the PEP 508 syntax described here to get pip 19.0 to play nicely with URLs: install_requires = ['package @ https://url/to/package.tar#egg=package']. Just keep in mind that PyPI will retire this functionality somewhere the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.