Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 556
Nant Avatar asked Dec 25 '22 12:12

Nant


1 Answers

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
like image 185
Sebastian Wozny Avatar answered Dec 27 '22 02:12

Sebastian Wozny