Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'extra' not working in pip 8.1.1 #3659

Closed
therefromhere opened this issue May 9, 2016 · 3 comments
Closed

'extra' not working in pip 8.1.1 #3659

therefromhere opened this issue May 9, 2016 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@therefromhere
Copy link

  • Pip version: 8.1.1
  • Python version: 2.7.11+
  • Operating System: Ubuntu 16.04

Description:

pip 8.1.1 is failing with the error "UndefinedEnvironmentName: 'extra' does not exist in evaluation environment." when I'm trying to install a package that uses extras_require (django-constance[database])

Downgrading to pip 8.1.0 resolves the issue.

What I've run:

In a clean virtualenv, with setuptools==21.0.0, I'm running

pip install 'django-constance[database]==1.1.2'

which fails with:

Collecting django-constance[database]==1.1.2
  Downloading django_constance-1.1.2-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/commands/install.py", line 328, in run
    wb.build(autobuilding=True)
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/wheel.py", line 748, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/req/req_set.py", line 448, in _prepare_file
    req_to_install, finder)
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/req/req_set.py", line 387, in _check_skip_installed
    req_to_install.check_if_exists()
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/req/req_install.py", line 997, in check_if_exists
    self.satisfied_by = pkg_resources.get_distribution(self.req)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 535, in get_distribution
    dist = get_provider(dist)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 415, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 808, in resolve
    if not req_extras.markers_pass(req):
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 993, in markers_pass
    return not req.marker or any(extra_evals) or req.marker.evaluate()
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/markers.py", line 278, in evaluate
    return _evaluate_markers(self._markers, current_environment)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/markers.py", line 203, in _evaluate_markers
    lhs_value = _get_env(environment, lhs.value)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/markers.py", line 185, in _get_env
    "{0!r} does not exist in evaluation environment.".format(name)
UndefinedEnvironmentName: 'extra' does not exist in evaluation environment.

If I run it without a version specifier, I get a different error:

pip install 'django-constance[database]'

gives

Exception:
Traceback (most recent call last):
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/commands/install.py", line 305, in run
    wheel_cache
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/basecommand.py", line 270, in populate_requirement_set
    wheel_cache=wheel_cache
  File "/home/johnc/.virtualenvs/pip_8_1_1/local/lib/python2.7/site-packages/pip/req/req_install.py", line 234, in from_line
    extras).extras
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2833, in parse
    req, = parse_requirements(s)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2781, in parse_requirements
    yield Requirement(line)
  File "/home/johnc/.virtualenvs/pip_8_1_1/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2790, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'__placeh'"

setup.py of django-constance for reference: https://github.com/jazzband/django-constance/blob/master/setup.py

@therefromhere
Copy link
Author

Hmm, maybe not a bug - reinstalling pip with

pip install -U pip --force-reinstall

seems to have fixed this for me.

@sorenwacker
Copy link

This does not fix it for me.

@lock
Copy link

lock bot commented May 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants