If we want to do some extra ordinary work (developing programs) then we need to use command prompt (windows console) for executing/compiling those programs. Command prompt (cmd) uses different-different libraries and packages which are already installed in our system for executing commands. It also uses windows environment variable for commands execution.
Talking about most of the software’s, they add their path to windows environment variable automatically while installation.Windows environment variable includes many variables, one of the most widely used variable is ‘PATH VARIBLE’. Path variable helps in running any .exe (executable) file whose path is given in Path variable directly through cmd without specifying it’s full path.


Let’s have a look at our Problem:

For the first time when we install python on our computer then we are able to run python through ‘Python Idle‘ but the issue arises when we try to run Python through command prompt, we came out with a cramp breaking error i.e. “not recognized as external or internal command“.



So, if we come to conclusion adding python path as Environment variable is quite necessary then only we can run python using command prompt, well adding Path environment variable has it’s own importance if we want to Connect Mysql with Python for that we need a install MySQL connector which only works if Path environment variable is set.
Problem Resolution:

Adding Path of installed python to windows environment variable:


=> Firstly open your My computer (This PC) properties by right clicking on it.

=> Now on left side of properties dialog box navigate to Advanced system settings.
=> Here we are redirected to Advanced tab in system dialog box. click on the Environment variables at very bottom.
=> Once our dialog box for Environment Variable opened, we are having two options : system variable & user variable.

Which one to choose, Lets have brief look and decide ??

=> User variable : If we want to set path for our own user account only .(Single User)
=> System Variable : If we want to set path for across the computer system, despite of any user.

In my opinion i will suggest to choose System variables, here we need to create 2 new variable and append to existing Path variable.

Create/ Add Variable :
Let’s get started with adding a new path. Click on the new button and it’ll open dialog box where we need to add variable name and its value

  • PY_HOME
    C:Python34    #change Python34 with your python version -> check your C drive 




  • PYTHONPATH
    %PY_HOME%Lib;%PY_HOME%DLLs;%PY_HOME%Liblib-tk;C:another-library


Append :

Rather than creating a new path, we mostly need to append a path variable, for that we need to select variable and click edit button and put “;” at the end of previous variable values. So, here simply select path variable click on edit button then put ; and copy path the given below exactly as shown in screenshot .

  • path
    %PY_HOME%;%PY_HOME%Scripts
That’s it, we have successfully added Python path variable to windows environment variable now, we can run python through windows console (command prompt). 

Categorized in: