Last Updated: February 25, 2016
·
1.889K
· scott2b

PyPi packages as dependency requirements in setup.py

If you are creating a setup.py for your Python project, you might have a requires property, like:

requires = [ 'some-pypi-package' ]

Trouble is, requires is designed for Python module dependencies, not installation dependencies. And with the dashes in the PyPi package name, you get the very unhelpful error:

ValueError: expected parenthesized list

The fix is to use install_requires, which supports PyPi packages as dependencies:

install_requires = [ 'some-pypi-package' ]