Pip: “额外”在 pip 8.1.1 中不起作用

创建于 2016-05-09  ·  3评论  ·  资料来源: pypa/pip

  • 点子版本:8.1.1
  • Python 版本:2.7.11+
  • 操作系统:Ubuntu 16.04

    描述:

pip 8.1.1 失败,出现错误“UndefinedEnvironmentName: 'extra' 在评估环境中不存在。” 当我尝试安装使用 extras_require (django-constance[database]) 的软件包时

降级到 pip 8.1.0 解决了这个问题。

我跑过的:

在干净的 virtualenv 中,使用 setuptools==21.0.0,我正在运行

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

失败了:

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.

如果我在没有版本说明符的情况下运行它,我会收到一个不同的错误:

pip install 'django-constance[database]'

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'"

django-constance 的 setup.py 供参考: https :

auto-locked

最有用的评论

嗯,也许不是错误 - 重新安装 pip

pip install -U pip --force-reinstall

似乎已经为我解决了这个问题。

所有3条评论

嗯,也许不是错误 - 重新安装 pip

pip install -U pip --force-reinstall

似乎已经为我解决了这个问题。

这不适合我。

由于关闭后没有任何近期活动,因此该线程已自动锁定。 请为相关错误打开一个新问题。

此页面是否有帮助?
0 / 5 - 0 等级