Mastodon87
Mastodon87

Reputation: 335

Pip Installation Python 3.6.1

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

Answers (2)

DavidG
DavidG

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.

  1. Open Start Menu and right click My Computer. Click on Advanced System Settings.
  2. Click on Environment Variables
  3. Find the system PATH variable and click Edit. You want to add Python to this PATH variable by adding exactly ;C:\Python36 (assuming that is where you installed Python)

Go back to the command line and type in pip install numpy (you can use pip3 instead of pip if you wish)

Upvotes: 1

Mohideen bin Mohammed
Mohideen bin Mohammed

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

Related Questions