简体   繁体   English

Django-admin.py无法正常工作(-bash:django-admin.py:未找到命令)

[英]Django-admin.py not working (-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? 我无法让django-admin.py工作......它位于第一个位置:/ Users / mycomp / bin /但我想我需要在另一个位置让终端识别它,不是吗?

Noob, Please help. Noob,请帮忙。 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

you need to export /Users/mycomp/bin to environment variable PATH 您需要将/ Users / mycomp / bin导出到环境变量PATH

for a session 为一个会议

export PATH=/Users/mycomp/bin:$PATH

for permanent, whenever you use bash 永久性,无论何时使用bash

echo "export PATH=/Users/mycomp/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc

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 try django-admin only too. 注意 :我认为django会在你安装的bin文件夹中自动创建可执行的django-admin文件(注意没有扩展名.py),所以你也应该尝试使用django-admin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM