Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify explicit python packaging dependencies in setup.py? [duplicate]

I want to create a python package mycode, to be installed using pip (setup.py), which has a dependency on another package base. To incoporate this package dependency I follow the setup.py instructions and created an entry in the setup function of setup.py which reads:

'requires': ['base']

After I have created the package with python setup.py sdist, I tried to install it via pip install, which successfully installed mycode, but nothing from base. It seems like the requires entry in setup.py was ignored.

Any ideas what is going wrong?

like image 559
Alex Avatar asked Apr 05 '13 12:04

Alex


1 Answers

You need to specify install_requires instead, see New and changed setup keywords.

The requires field was too vague and imprecise, so the setuptools folk (so easy_install, from which pip evolved) added more specific fields. In addition, there are setup_requires and test_requires fields for dependencies required for setup.py and for running tests.

like image 166
Martijn Pieters Avatar answered Oct 27 '22 04:10

Martijn Pieters