As I understand, Python 2.7.9 comes with Pip installed, however when I try to execute a Pip command from CMD (Windows) I get the following error:
'pip' is not recognized as an internal or external command, operable program or batch file.
When I type python
I do get the following, which suggests it has been installed correctly:
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
I did however need to add some environmental variables to get the python part working on CMD:
Add to the environment variable
PATH
:"C:\Python27\"
Define the system variable
PYTHONPATH
:"C:\Python27\"
I cannot find a Pip folder within the Python directory, however there is a folder called "ensurepip" in C:\Python27\Lib\
.
Does anybody know how can I get Pip commands to start working in CMD?
Newer versions of Python come with
py
, the Python Launcher, which is always in thePATH
.Here is how to invoke
pip
viapy
:py
allows having several versions of Python on the same machine.As an example, here is how to invoke the
pip
from Python 2.7:Simple solution that worked for me is, set the path of python in environment variables,it is done as follows
In the edit option click add and add following two paths to it one by one:
and now close cmd and run it as administrator, by that pip will start working.
Go to the folder where Python is installed .. and go to Scripts folder .
Do all this in CMD and then type :
to check whether its there or not .
As soon as it shows some list it means that it is there .
Then type
Make sure to also add "C:\Python27\Scripts" to your path. pip.exe should be in that folder. Then you can just run:
In my case I was trying to install Flask. I wanted to run pip install Flask command. But when I open command prompt it I goes to C:\Users[user]>. If you give here it will say pip is not recognized. I did below steps
On your desktop right click Computer and select Properties
Select Advanced Systems Settings
In popup which you see select Advanced tab and then click Environment Variables
In popup double click PATH and from popup copy variable value for variable name PATH and paste the variable value in notepad or so and look for an entry for Python.
In my case it was C:\Users\[user]\AppData\Local\Programs\Python\Python36-32
Now in my command prompt i moved to above location and gave pip install Flask
Open Command Prompt as administrator and change directory to python and then change directory to Scripts by typing cd Scripts then type pip.exe and now you can install modules Step by Step:
Open Cmd
type in "cd \" and then enter
type in "cd python2.7" and then enter
type in "cd Scripts" and enter
Now enter this "pip.exe"
Now it prompts you to install modules