简体   繁体   中英

How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install djangorestframework-extensions using pip

I am trying to install djangorestframework-extensions using the command:

pip install djangorestframework-extensions

and it shows the error:

 ERROR: Command errored out with exit status 1:
     command: /home/anamaria/workspace/licenta/AllFest2/festivals/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py'"'"'; __file__='"'"'/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/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 /tmp/pip-install-r9q6vdlo/djangorestframework-extensions/pip-egg-info
         cwd: /tmp/pip-install-r9q6vdlo/djangorestframework-extensions/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py", line 48
        print "You probably want to also tag the version now:"
                                                             ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("You probably want to also tag the version now:")?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

What should i do?

this package seems to suffer incompatibilities between Python2 and python3. you can try to fix "/tmp/pip-install-r9q6vdlo/djangorestframework-extensions/setup.py" by hand replacing all '''print something''' by '''print(something)''' it might fail so if you have the choice it's probably better to run it with python 2 despite python two is now old.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM