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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With