pipenv install django=~3.1.0 command giving error

Question:

Installing django=~3.1.0...
Resolving django=~3.1.0...
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 102, in __init__
    req = REQUIREMENT.parseString(requirement_string)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pyparsing/core.py", line 1141, in parse_string
    raise exc.with_traceback(None)
pipenv.patched.pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found '='  (at char 6), (line:1, col:7)

I am getting above error in command line of mac for pipenv install django=~3.1.0

Answers:

The actual command should be :

 pipenv install django~=3.1.0

you are using =~ instead of ~= on the pip

so it should be django~=3.1.0

if the following django versions exist, it would choose 3.1.0:
else it will use the version found.

For clarification, each valid pair is equivalent that can be used

~= 3.1.0
>= 3.1.0, == 3.1.*
~= 3.1
>= 3.1, == 0.*
Answered By: Surya R
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.