开发者

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.

  1. Right click "My Computer"
  2. Select "Properties"
  3. Click the "Advanced" tab in the new window.
  4. Click on the "Environment Variables" button.
  5. Edit the variable named PATH

Information about doing the latter at Microsoft: http://support.microsoft.com/kb/310519

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜