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

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

    pip is run from the command line, not the Python interpreter. It is a program that installs modules, so you can use them from Python. Once you have installed the module, then you can open the Python shell and do import selenium.

    The Python shell is not a command line, it is an interactive interpreter. You type Python code into it, not commands.

提交回复
热议问题