In order to execute our python program from cmd or terminal python path is set in our machine.
The path is stored in an environment variable, which is a named string maintained by the operating system. This variable contains information available to the command shell and other programs.

The path variable is named as PATH in Unix or Path in Windows (Unix is case sensitive; Windows is not).

  • Important step )

    To set python path first find the directory where we have installed our python software .
    In my case :

    Important step )
    Example)
    drag_handle
     #copy the path(in my case) 
    C:\Users\Durgesh\AppData\Local\Programs\Python\Python36
  • Setting Temporary Python Path in windows

    Open CMD and type the following command.

     set path = python path (in my case)

    Setting Temporary Python Path in windows
    • Now test the temporary path , type few python commands

      Setting-Temporary-Python-Path-in-windows557909996109.jpg
  • Setting Permanent Python Path in Windows

    Permanent path is set to environment variable in windows .
    In order to set permanent path first copy the path of python installation directory.
    then follow the steps.

    • Step-1 ) Right click on ThisPC

      Setting-Permanent-Python-Path-in-Windows558428611970.jpg
    • Step-2 ) Click on Advanced system settings
      Click on Environment Variables...

      Setting-Permanent-Python-Path-in-Windows558-1896135246.jpg
    • Step-3 ) Click on New...

      Setting-Permanent-Python-Path-in-Windows558-1875562736.jpg
    • Step-4 ) Enter the details
      Variable Name : path
      Varibale value : path of python installation directory.

      Setting-Permanent-Python-Path-in-Windows558-1219625090.jpg
    • Step-5 ) Now Open CMD and type python

      Setting-Permanent-Python-Path-in-Windows558-1612642203.jpg

What next?

The next topic is First Python Program

Share this page