Django:创建新项目时,“django-admin.py:command not found”错误弹出 [英] Django: When creating a new project, "django-admin.py: command not found" Error pops up
问题描述
我一直在追踪django网站上的教程,并且遇到关于设置Django的问题:
https://docs.djangoproject.com/en/dev/intro/tutorial01/
I've been following the tutorial on the django website and have been running into a problem regarding setting up Django: https://docs.djangoproject.com/en/dev/intro/tutorial01/
我有通过使用setup.py的指南安装Django,但是当我在终端上运行django-admin.py startproject mysite时,会输出错误-bash:django-admin.py:command not found。我曾尝试过django-admin按照一些谷歌搜索,有些搜索告诉我尝试以下命令。
I've installed Django through their guide using setup.py, but when I run "django-admin.py startproject mysite" on the terminal, it outputs the error "-bash: django-admin.py: command not found". I've tried django-admin as per some google searches and some searches have told me to try the following commands
cd /usr/local/bin
ln -s /usr/local/django/trunk/django/bin/django-admin.py django-admin.py
但是在这种情况下,我继续得到ln:django-admin.py:Permission denied。
but I continue to get "ln: django-admin.py: Permission denied" in that case.
I使用macports Python,并想知道我是否可以得到任何有关的事情的帮助。非常感谢您提前!
I use the macports Python and was wondering if I could get any help regarding the matter. Thank you very much in advance!
解决方案:
感谢Doug!
SOLUTION: Thanks Doug!
经过一些谷歌搜索发现: https://code.djangoproject.com/wiki/InstallationPitfalls ,告诉我一个类似的解决方案。我需要链接到我的bin并授予权限。另外需要使用django-admin2.6.py运行的命令将不起作用。
After some googling I found: https://code.djangoproject.com/wiki/InstallationPitfalls which told me a similar solution. I needed to link to my bin and give permissions. Also the command needed to be run with django-admin2.6.py otherwise would not work.
推荐答案
尝试:export PATH = $ PATH:/ usr / local / django / trunk / django / bin
Try: export PATH=$PATH:/usr/local/django/trunk/django/bin
这篇关于Django:创建新项目时,“django-admin.py:command not found”错误弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!