Why does “pip install” inside Python raise a SyntaxError?

后端 未结 8 814
天命终不由人
天命终不由人 2020-11-21 05:46

I\'m trying to use pip to install a package. I try to run pip install from the Python shell, but I get a SyntaxError. Why do I get this error? H

8条回答
  •  感动是毒
    2020-11-21 06:12

    To run pip in Python 3.x, just follow the instructions on Python's page: Installing Python Modules.

    python -m pip install SomePackage
    

    Note that this is run from the command line and not the python shell (the reason for syntax error in the original question).

提交回复
热议问题