question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipenv doesn't support compatible release version specifier

See original GitHub issue

https://www.python.org/dev/peps/pep-0440/#version-specifiers

$ pipenv install --dev 'pytest~=3.2'
Did you mean pytest? [Y/n]: n
Installing pytest~=3.2…
Requirement already satisfied: pytest~=3.2 in /home/ionasal/.local/share/virtualenvs/mir.protology-Didwf7Vs/lib/python3.6/site-packages
Requirement already satisfied: py>=1.4.33 in /home/ionasal/.local/share/virtualenvs/mir.protology-Didwf7Vs/lib/python3.6/site-packages (from pytest~=3.2)
Requirement already satisfied: setuptools in /home/ionasal/.local/share/virtualenvs/mir.protology-Didwf7Vs/lib/python3.6/site-packages (from pytest~=3.2)

Adding pytest~=3.2 to Pipfile's [dev-packages]…
Locking [dev-packages] dependencies…
Traceback (most recent call last):
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 92, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 1617, in parseString
    raise exc
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 1607, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 3376, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/pyparsing.py", line 3164, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 6), (line:1, col:7)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 81, in __init__
    req = Requirement(req)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'=3.2'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ionasal/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1852, in install
    do_lock(system=system, pre=pre)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1027, in do_lock
    pre=pre
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/utils.py", line 386, in resolve_deps
    constraint = [c for c in pip.req.parse_requirements(t, session=pip._vendor.requests)][0]
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/utils.py", line 386, in <listcomp>
    constraint = [c for c in pip.req.parse_requirements(t, session=pip._vendor.requests)][0]
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_file.py", line 93, in parse_requirements
    for req in req_iter:
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_file.py", line 158, in process_line
    isolated=isolated, options=req_options, wheel_cache=wheel_cache
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 234, in from_line
    wheel_cache=wheel_cache, constraint=constraint)
  File "/home/ionasal/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 90, in __init__
    "Invalid requirement: '%s'\n%s" % (req, add_msg))
pip.exceptions.InstallationError: Invalid requirement: 'pytest=3.2'
= is not a valid operator. Did you mean == ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Oct 9, 2017

It’s probably because semantic versioning is not universal in Python land, and most people prefer == instead.

1reaction
and800commented, Oct 9, 2017

Fixed it in #863.

I wonder how 4k people starred this package haven’t noticed this useful feature missing for so long. I fell into it yesterday and it’s my second day using pipenv. ~= operator is awesome ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic Usage of Pipenv - Read the Docs
Specify your target Python version in your Pipfile 's [requires] section. Ideally, you should only have one target Python version, as this is...
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
pipenv requires python 3.7 but installed version is 3.8 and ...
My way to solve the problem is simply delete the old Pipfile and input pipenv shell in the terminal. Then it will build...
Read more >
Release and Version History — pipenv 2022.12.20.dev0 ...
Bug Fixes¶. Fix regression: pipenv does not sync indexes to lockfile. ... Bug Fixes¶. Stop building universal wheels since Python 2 is no...
Read more >
PEP 440 – Version Identification and Dependency Specification
Public version identifiers MUST NOT include leading or trailing whitespace. ... A compatible release clause consists of the compatible release operator ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found