Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting the python path in windows xp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

i am just a complete newbie to python , and i dont even know where to start to set the python path in environment variable named PATH ,which is to cause the directory containing the file named "python.exe" to be listed in my system environment variable named PATH, so that my computer will ready to use the script files,i am using windows XP and python 2.2.1, i have tried to using the 'my computer' properties(properties-advance tab-environmental variable) i just dont know what to put in the boxes in environmental variable window, can somebody help me ,treat me as completely unknowledgable to computer....
 
Hi slyword,

I do not have WindowsXP, but I am using Windows2000. I presume the steps to set the PATH variable are similar, if not the same.

Here is how I would set the PATH environmental variable on my pc:

Click the Windows 'Start' button,
Click 'Settings',
Click 'Control Panel',
Click the 'System' icon in the Control Panel window,
Select the 'Advanced' tab.
Select the button labelled 'Environment Variables'.
At this point the environment variables window would open, with 2 panes:
The first one labelled 'User variables for GRANT',
The second one labelled 'System variables'.

I normally make my changes in the second one, but I am the only user of my PC, and I have administrator rights. You probably wouldn't be able to access the 'System variables' section if you don't have administrator rights.

To change the PATH variable, either in the 'User variables' or 'System variables' section, highlight the entry labelled 'Path' then click on the 'Edit' button.

When you click the 'Edit' button, a small window opens with 2 entry boxes:
The first on labelled 'Variable name',
the second labelled 'Variable value'.

You need to add your path to the end of what is in the 'Variable value' entry box. For example, you would probably want to add something like the following to the end of the current entry:
C:/Python22;

Of course, you must put the path to the Python directory on your system. It's a good idea to end it with a semi-colon (;).


(Actually, I just noticed that the only reference to Python in my path is 'C:\Python22\.;'. I am not sure what the extra '\.' is for, but it may be necessary. I imagine it was entered automatically during setup. So, you may need to include the '\.')


Since you are using WindowsXP, and the steps might be slightly different. If so, you could just go to the Windows 'Start' menu, select 'Help'

As for what to add, for normal, everyday operation of python, the above entry with the path to the Python directory is sufficient.



Hope this helps,
Grant.

 
Slyword after you add python22 yo your path go to cmd prompt and type python and hit enter. You should get a python prompt (>>>) if not go back and check path see if python22 is still at end. After that when you create a file in notepad or the editor you're using make sure name file match the name of your directory if cmd prompt says C:\documents and settings\name "yours or whatever" you have to include this before file name or python won't open it. File name save as C:\documents and Settings\name\file name. I was having same problem as you just figgured it out. also take a look at FAQ AT section 8 is about windows. Good luck Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top