我是django和python的新手。我使用的是Windows 7和Eclipse IDE。我安装了python 2.7,django和pip。我创建了一个名为PYTHONPATH的系统变量,值为C:\Python27;C:\Python27\Scripts
。我无法设置django和pip的路径。当我在powershell中键入django-admin.py和pip时,它显示commandnotfoundexception.
我附加了我的django文件和pip文件的屏幕截图。
请帮帮我
答案 0 :(得分:2)
您需要设置Powershell特定路径变量。它不知道要查找名为pythonpath
的环境变量。这仅对python感知应用程序(例如Python模块的安装程序)有帮助。
您需要将Python目录添加到Powershell中的$env:Path
环境变量中。见Setting Windows PowerShell path variable
$ env:Path + =“; C:\ Python27; C:\ Python27 \ Scripts”
答案 1 :(得分:0)
另外,如果您刚开始使用Django和Eclipse,请确保将PyDev解释器设置配置为包含site-packages目录。这将确保Eclipse可以找到您的Django包。
您可以在此处找到有关在Eclipse中设置PYTHONPATH的更多详细信息: