Django-admin.py无法正常工作(-bash:django-admin.py:command not found) [英] Django-admin.py not working (-bash:django-admin.py: command not found)
问题描述
我无法让django-admin.py正常工作...它位于第一个位置:
/ Users / mycomp / bin /但我认为我需要它在另一个位置来终端识别它,不是?
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,请帮忙。谢谢!!
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
推荐答案
您需要导出/ Users / mycomp / bin到环境变量PATH
you need to export /Users/mycomp/bin to environment variable PATH
一个会话
export PATH=/Users/mycomp/bin:$PATH
永久性,
echo "export PATH=/Users/mycomp/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc
注意 :我想django自动在bin文件夹中创建可执行文件 django-admin
文件(注意没有扩展名.py)当你安装,所以你应该尝试 django-admin
也。
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-admin.py无法正常工作(-bash:django-admin.py:command not found)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!