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.
Answer from Lennart Regebro on Stack Overflowpip 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.
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
PIP comes up as Invalid Syntax
python - Invalid syntax error for 'pip install --upgrade pip' - Stack Overflow
python - Why does "get-pip.py" complain about invalid syntax? - Unix & Linux Stack Exchange
Python newbie - PIP / invalid syntax error - Stack Overflow
Videos
Those are not the same commands I found on their website: This is what I found: If Python 3 is installed:
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
For Python 2:
python -m pip install --upgrade pip
python -m pip install jupyter
Hope this helps.
So, I found a solution. I needed to add pip to my PATH Environment variable. I had python added, but I also needed to add the directory where pip was located.