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

后端 未结 8 1073
天命终不由人
天命终不由人 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:13

    Use the command line, not the Python shell (DOS, PowerShell in Windows).

    C:\Program Files\Python2.7\Scripts> pip install XYZ
    

    If you installed Python into your PATH using the latest installers, you don't need to be in that folder to run pip

    Terminal in Mac or Linux

    $ pip install XYZ
    

提交回复
热议问题