setuptools: 20.5.0+ breaks existing setup.py files - UndefinedEnvironmentName
The latest 20.6.4 PyPI is breaking our setup.py files with the following exception:
Traceback (most recent call last):
File "setup.py", line 163, in <module>
cmdclass={'test': PyTest},
File "/opt/python/2.7.9/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/opt/python/2.7.9/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/opt/python/2.7.9/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/setuptools/command/test.py", line 152, in run
self.distribution.fetch_build_eggs(self.distribution.tests_require)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pkg_resources/__init__.py", line 814, in resolve
if req.marker and not req.marker.evaluate():
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py", line 273, in evaluate
return _evaluate_markers(self._markers, current_environment)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py", line 198, in _evaluate_markers
lhs_value = _get_env(environment, lhs.value)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py", line 180, in _get_env
"{0!r} does not exist in evaluation environment.".format(name)
pkg_resources._vendor.packaging.markers.UndefinedEnvironmentName: 'extra' does not exist in evaluation environment.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 50 (18 by maintainers)
Commits related to this issue
- Bypass environment marker evaluation in requirements resolution. Ref #523. — committed to pypa/setuptools by jaraco 8 years ago
- Build virtualenv as ubuntu user Building the virtualenv as root caused us to run into [this][1] pip/setuptools issue. The suggested work around didn't help as the root owned virtualenv's pip didn't ... — committed to nhsengland/iit-infrastructure by ghickman 6 years ago
- Build virtualenv as ubuntu user Building the virtualenv as root caused us to run into [this][1] pip/setuptools issue. The suggested work around didn't help as the root owned virtualenv's pip didn't ... — committed to nhsengland/iit-infrastructure by ghickman 6 years ago
This seems to be broken again in setuptools 28.0.0: I was generating message files with pybabel from jinja templates when I got this exception.
Downgrading setuptools to 27.3.1 fixed the issue.
Wonder if the troubleshooting tip mentioned of hacking the code to print the requirement can be made into debug logging so that it can be turned on easily whenever there is a problem.
Perhaps even modify things so that the current requirement can automatically be printed whenever an exception occurs?
Ordinarily, I’d probably take a look at the code and maybe submit a PR for what I just suggested, but I’m AFK for a few days, so I’ll just leave it as a suggestion for anyone who has motivation and a keyboard.
Simply reinstalling the same version of setuptools solves it too. e.g.
Was also trying to install CKAN, and indeed @rwillmer’s fix worked.
Same here:
setuptools
version:After downgrading and upgrading
setuptools
as suggested by @rwillmer the error is gone.In order to set up CKAN I was using this Ansible script:
https://github.com/sirex/ckan-ivpk-import/blob/master/ckan.yml