Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would sure like to be able to type "python" on my command line instead of C:\Python27\python.exe. So to that end I'm trying to get the environment variable set up for myself.

Problem is, I can't seem to get the Python system environment variable to set up on my Windows 7 install. So far I have (as variable PYTHONPATH):


Not sure why that won't work. I've tried with a trailing semicolon and without, with backslashes at the end of the folders, and everything. What am I doing wrong?

share|improve this question
up vote 6 down vote accepted

You need to set the Python directory as your PATH, not PYTHONPATH. The latter is a separate variable that Python uses. Also, you only need the main directory (C:\Python27).

share|improve this answer
Awesome. That's something none of the little pseudo-tutorials told me :P – Brian Hicks Aug 1 '10 at 23:15

Control Panel>System

Advanced Settings (Hyperlink-like-text) brings up the XP "System" dialog.

Under the Advanced Tab: Environment Variables button

In the Environment Variables Dialog

you can add it to the PATH variable as a User variable or System Variable.

share|improve this answer
Windows 7, not XP. – Hello71 Aug 1 '10 at 23:12
That is for Windows 7 – Cor Aug 1 '10 at 23:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.