Django/Python on Windows — Setting PATH Environment Variable

What is the PATH?

The PATH environment variable is in general a list of directories that the operating system will search through when programs attempt to execute a command.

For example, say we go into the windows command prompt or Ubuntu’s bash shell and type in “foobar” – the operating system will attempt to locate an executable (program) named “foobar” in the folders listed in the PATH. Replace “foobar” with “python” or “” and you start to understand why this is useful.

How do we set the PATH?

To set the PATH on Vista or Windows 7:

Push the windows button and type “environment variable” on the search bar and select “Edit environment variables for your account”.

Non Vista/Windows 7 users just right click on My Computer, go to Properties, click Advanced Properties, then the Environment Variables button to get to the same place.

In the Environment Variables screen, look for the “Path” variable under the “System Variables” section on the bottom. If it doesn’t exist, just make a new one.

Edit or enter in folder paths separated by ; — Append whatever you like to the string ending with a “;”

Do not delete the default path – append to it.



19 thoughts on “Django/Python on Windows — Setting PATH Environment Variable

  1. Pingback: gcc issue
  2. I tried this but it doesn’t work.Can any one help me ?

    C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Common Files\ArcSoft\Bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Program Files\Windows Live\Shared;

    E:\install soft\Python\Python install\python.exe

      1. added that and tried to test it in cmd , it shows this

        ‘python’ is not recognized as an internal or external command,
        operable program or batch file.

      1. Hey , yuji thanks for your help I was able to add the path, unfortunately I was trying to add the path in another directory but i installed in some other directory, once i tried in the correct directory the problem was solved. Thanks again🙂

  3. Anyone interested in modifying the PATH or any other environment variable in Windows should check out “Rapid Environment Editor”.

  4. I don’t understand what the path needs to be set to. Also I don’t have an option of editing the path because the edit button is greyed out. Thanks for the help but I’m still stuck : (

    1. The path needs to be set to the directory of any executable scripts you want access to from the command line. Say you have a script – if you put the directory it’s in into the path, then you can execute foo from any command line.

      If you can’t edit it – then that’s a different problem. Do you need admin rights or something?

    2. I had the same problem, but there’s another way to get there. On your desktop, right-click My Computer. (If you don’t have that icon on your desktop, go to the Desktop via Windows Explorer.) Select Properties. Then click Advanced System Settings on the left, and then click the Environment Variables button at the bottom. Hopefully you’ve figured all that out by now, and this comment will just be useful to the next person to come along.

  5. This is exactly what I was looking for, however I can’t access my system variables, only the user variables (I have an admin account on my windows 7). Anybody got an idea why? And how I can get access?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s