"I am typing into the terminal "pip install numpy" and I get back "SyntaxError: invalid syntax"
Is there something I should be doing before hand to get this to work?
I’m not sure exactly what I should be doing to get it to work. I am very new to programming in general."
For anyone else that has this issue in the future: I was putting this into the python terminal instead of the terminal called "powershell"
Also you may have to install pip first
2
Answers
You are using the python interactive terminal instead of the shell terminal. In the python interactive terminal, you can directly enter the python code and press Enter to run. But the
pip
command needs to be executed in a shell terminal.You can use hshhsh or hfhh to exit the current interactive terminal, and then use the
pip install numpy
to install the package.You are actually typing
pip install numpy
as a Python code. You should first exit the Python’s interpreter by enteringquit()
Then enterpython -m pip install numpy
in your terminal session and it should work well now.