Search code examples
pythondjangojinja2

Got this error while executing command pip install jinja


When I try to execute the following command:

pip install jinja

I have the following error:

Collecting Jinja
Using cached Jinja-1.2.tar.gz (252 kB)

ERROR: Command errored out with exit status 1:
 command: 'C:\Program Files\Python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\siddh\\AppData\\Local\\Temp\\pycharm-packaging\\Jinja\\setup.py'"'"'; __file__='"'"'C:\\Users\\siddh\\AppData\\Local\\Temp\\pycharm-packaging\\Jinja\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\pip-egg-info'
     cwd: C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\
Complete output (6 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\siddh\AppData\Local\Temp\pycharm-packaging\Jinja\setup.py", line 28
    except DistutilsError, e:
                         ^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

How can I solve this?


Solution

  • please, try:

    pip install Jinja2
    

    We recommend using the latest version of Python. Jinja supports Python 3.7 and newer. We also recommend using a virtual environment in order to isolate your project dependencies from other projects and the system.

    Best regards!