Django-admin.py 不工作(-bash:django-admin.py:找不到命令)
我无法让 django-admin.py 工作......它位于第一个位置: /Users/mycomp/bin/ 但我想我需要它在另一个位置以便终端识别它,不是吗?
菜鸟,请帮忙。谢谢!!
my-computer:~/Django-1.1.1 mycomp$ sudo ln -s /Users/mycomp/bin/django-admin.py /Users/mycomp/django-1.1.1/django-admin.py
Password:
ln: /Users/mycomp/django-1.1.1/django-admin.py: File exists
my-computer:~/Django-1.1.1 mycomp$ django-admin.py --version
-bash: django-admin.py: command not found
I'm having trouble getting django-admin.py to work... it's in this first location:
/Users/mycomp/bin/ but I think I need it in another location for the terminal to recognize it, no?
Noob, Please help. Thanks!!
my-computer:~/Django-1.1.1 mycomp$ sudo ln -s /Users/mycomp/bin/django-admin.py /Users/mycomp/django-1.1.1/django-admin.py
Password:
ln: /Users/mycomp/django-1.1.1/django-admin.py: File exists
my-computer:~/Django-1.1.1 mycomp$ django-admin.py --version
-bash: django-admin.py: command not found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当您使用 bash 时,您都需要将 /Users/mycomp/bin 导出到
会话
永久
的环境变量 PATH 注意:我认为 django 会自动创建可执行文件
django-admin
安装时将文件放在 bin 文件夹中(注意没有扩展名 .py),所以你也应该尝试 django-admin 。you need to export /Users/mycomp/bin to environment variable PATH
for a session
for permanent, whenever you use bash
Note: And I think django automatically create executable
django-admin
file in the bin folder (notice there is no extensions .py) when you installed, So you should trydjango-admin
only too.