Reputation: 335
I am a beginner in programming with Python. I have installed Python 3.6.1, and when I try to install pip
(or any other package), this error appears (both in the command and shell):
install pip
^
SyntaxError: invalid syntax
I tried also with pip -m pip
, but nothing, still the same error.
I would be very grateful if you could help me.
Upvotes: 0
Views: 4240
Reputation: 25362
To install a Python package, you need to be in the command line as @MohideenibnMohammed suggested. You cannot install a package from within a Python script using pip
.
You have installed Python 3.6.1 which will have pip
already installed so you don't need to try and install that again.
Next, you need to make sure that Python is added to your PATH.
Go back to the command line and type in pip install numpy
(you can use pip3
instead of pip
if you wish)
Upvotes: 1
Reputation: 20137
I think you are trying to use pip command in python console
instead of terminal.
or check your command again .. pip install package
otherwise try this,
use pip3 install package
to install instead of pip install package
Upvotes: 0