我正在尝试第一次安装django并尝试通过http://net.tutsplus.com/tutorials/python-tutorials/python-from-scratch-creating-a-dynamic-website/。
我已经下载了Django-1.4.3。这是我的Git-Bash目录
$ ls
Django-1.4.3 ReleaseNotes.rtf doc git-cheetah libexec
Git Bash.vbs bin etc git-cmd.bat share
README.portable cmd git-bash.bat lib ssl
根据我必须执行的教程:
cd Django-1.4.3
python setup.py install
当我做后者时,我得到:
$ python setup.py install
sh.exe": python: command not found
我需要在哪里放置python以允许它执行此命令?
答案 0 :(得分:3)
假设已经安装了Python,这个错误消息意味着Git-Bash不知道你的python.exe在哪里。
要像你提议的那样从Git-Bash运行python命令,你必须在Windows的PATH
环境变量中追加python.exe的路径。
在Windows上运行python的其他方法是使用正常的命令提示符(而不是Git-Bash)使用完整路径。例如,如果python的安装目录是C:\Python27
:
cd Django-1.4.3
C:\Python27\python.exe setup.py install