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

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

 'requires': ['base'] 

After I created the package with python setup.py sdist , I tried installing it through pip install , which successfully installed mycode , but nothing from base . It looks like the requires entry in setup.py been ignored.

Any ideas on what's going wrong?

+7
source share
1 answer

Instead, you need to specify install_requires , see New and changed setup keywords .

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

+10
source

All Articles