views:

89

answers:

4

I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run properly?

+1  A: 

you can't run a command that isn't in your path. it should be set globally when you installed python.

type 'set' at a dos prompt and look at the PATH variable. c:\python25 (or whever you installed python) has to be in that variable ie PATH=c:\windows;c:\python25;... etc

if it isn't in PATH then you or the installer missed the part where you needed to set it. It can be done from the 'Environment Variables' button in the 'System' control panel.

SpliFF
ya but i even tried reinstalling python. It didnt seem to work
Vicky
try a reboot, environment variables in windows may need to load at startup (not sure). at least drop out of the shell you're currently in. also go to the path you set and make sure it's REALLY there. >> cd '%PYTHONPATH%'
SpliFF
python do exist in c:\python25 dir. Also i tried rebooting the system...
Vicky
A: 

Either use the system control panel to set the PATH environment variable that applies permanently or

Reinstall Python as a system administrator so that the installer can set the registry and environment variables for you.

If you install the "just for me" option, then you have to set the PATH variable in the control panel.

S.Lott
but i gave the option as all users only. Then why isn't it working. Also I added PYTHONPATH variable in controlpannel. still not working
Vicky
No, the problem is the PATH setting, without which it can't find the Python executable, not the PYTHONPATH which is used within Python itself to find packages.
Daniel Roseman
@Daniel Roseman: Thanks. Fixed it.
S.Lott
hey it worked. I created a PATH variable and specified the path. Now its working fine.
Vicky
+2  A: 

You probably need to add Python to you dos path. Here's a video that may help you out:

http://showmedo.com/videotutorials/video?name=960000&fromSeriesID=96

John Montgomery
A: 

In your path, I think you need to have both the location of the Python install and the Python\Scripts folder. For example, on XP, I have C:\Python25;C:\Python25\Scripts. Can you verify that you have both?

Brett Bim