Nant
Nant

Reputation: 569

python pip install not working on windows

I have python 2.7.10 installed on windows and I am trying to install Django on the commandline with the following command:

C:/users/user/myproject> python pip install django

This displays the following error:

python: can't open file 'pip' [Errno 2] No such file or directory

Python is installed in C:\Python27 and the PATH environment variable is also set to that.

Why is pip not working?

Upvotes: 4

Views: 20353

Answers (2)

Sebastian Wozny
Sebastian Wozny

Reputation: 17526

Since Python 2.7.9 pip is included when python is installed.

However the scripts subfolder of your python installation might not be added to your PATH environment variable, and hence inaccessible by just typing pip install. However as long as your python executable is on the path, you can use the python -m flag to execute the pip module as a script:

python -m pip install SomePackage

This should work from the command line as long as python is on PATH.

If you would like to use pip directly from the cmd.exe prompt you need to add the scripts directory to your PATH environment variable:

SET PATH=%PATH%;C:\Python27\scripts

Upvotes: 11

Pavan Nath
Pavan Nath

Reputation: 1494

Some times in windows it especially needs Microsoft visual c++ compiler. If such error persists you can verify the log file and If needed you can download here http://aka.ms/vcpython27

Upvotes: 0

Related Questions