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
pip
which 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
setuptools
andpip
install packages from wheels.setuptools
installs (or seems to) only install one package from a wheel, whilepip
will install everything, and if there are more than one package, then it will install more. So,pip
was installingazure.common
by mistake, but there is no way to intentionally install just that package. At the minimum, you will also getazure.profiles
plus 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?
Azure does not provide the
common
extra dependency.pip install azure[common]
shows the warning about it.