how to add python to system dependency on win7?
i've got a problem when i'm doing dev
I managed to use python manage.py runserver in a CMD shell but the system cant find python
How could I add python to th开发者_JS百科e system dependency to make the commandline work?
There are two basic ways you can do this in Windows.
Setting the PATH in the cmd
shell
The first way is only local to the CMD
shell you are currently in, and will have to be done again if you opened a new shell.
You can set your PATH
to include the directory where python.exe
is located.
In your CMD shell you can do:
set PATH=%PATH%;C:\path\to\python\install
So if Python was installed in C:\Python27
, you would do this:
set PATH=%PATH%;C:\Python27
Setting the environment for your user throughout Windows
Alternatively, you can set your PATH
permanently by changing the environment variable in Windows. Setting this will affect the rest of your Windows environment.
- Right click "My Computer"
- Select "Properties"
- Click the "Advanced" tab in the new window.
- Click on the "Environment Variables" button.
- Edit the variable named
PATH
Information about doing the latter at Microsoft: http://support.microsoft.com/kb/310519
精彩评论