Related to this question: What do square brackets mean in pip install?
I have a setup.py file that needs to install azure[common] package. However, if I try:
setup(
...
install_requires=['azure[common]'],
...
)
This results in an error:
pkg_resources.UnknownExtra: azure 4.0.0 has no such extra feature 'common'
But, if I do:
pip install 'azure[common]', then it works.
There were a lot of bugs and unexpected behavior involved in the experiment above, so the question doens't really make sense anymore.
- There's a bug in
pipwhich causes random stuff to be installed if "extra" package isn't found. So,pip install 'azure[common]'shouldn't have worked at all. It's an error that led me to believe there was such a package. - There's an inconsistency between how
setuptoolsandpipinstall packages from wheels.setuptoolsinstalls (or seems to) only install one package from a wheel, whilepipwill install everything, and if there are more than one package, then it will install more. So,pipwas installingazure.commonby mistake, but there is no way to intentionally install just that package. At the minimum, you will also getazure.profilesplus a fake packageazure_common, which doesn't really contain anything.
Given all this new info, I reformulated the question here: How to make setuptools install a wheel containing multiple packages?