-bash: django-admin.py: command not found (Django Installation)

与世无争的帅哥 提交于 2019-12-12 02:36:55

问题


Sorry I realize this is a very novice question: I am not yet skilled in Python. I have tried to follow a few basic django tutorials to get a simple site running. I am getting the error -bash: django-admin.py: command not found in Mac Terminal when trying to use the command django-admin.py startproject FirstBlog function.

If I try python django-admin.py startproject FirstBlog instead, terminal returns

 Traceback (most recent call last):
 File "django-admin.py", line 2, in <module>
 from django.core import management
 ImportError: No module named django.core

I have tried these commands from different directories, but still the same result. This is MacOSX 10.5.8 and Bitnami DjangoStack 1.4. I have tried to find the answer elsewhere on stackoverflow and google: people have suggested changing the path to django-admin.py. I have tried but either have written my paths incorrectly or this isn't the problem.

If more information is required I will gladly supply it. Thank you.

EDIT

I have abandoned the BitNami DjangoStack after a lot of difficulty installing the program. I have reverted to installing Django/mysql manually, which turns out to be a lot easier. Thank you.


回答1:


It looks like Bitnami supplies its own version of Python and that's where Django is installed so you need to make sure you are running that Python and not an Apple-supplied system Python, for example. According to the quick start guide, it looks you can either use their supplied console application which should ensure you are running with their Python:

/Applications/djangostack-1.4-0/use_djangostack

or you may be able to use the absolute path to that Python:

/Applications/djangostack-1.4-0/python/bin/python django-admin.py


来源:https://stackoverflow.com/questions/10059644/bash-django-admin-py-command-not-found-django-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!