Reputation: 1
I am new to Django and trying to create my first project. I know that I need to run the command "python django-admin.py startproject iFriends" (iFriends is the folder that I created for the project). Terminal is responding with - "-bash: django-admin.py: command not found." Why is it not working? Is this the wrong command?
I am using Mac OS X 10.7.3, Django 1.4, and Python 2.7.2.
Upvotes: 0
Views: 4775
Reputation: 8021
As a workaround, run this is Python
import site; site.getsitepackages()
Replace the django-admin with python (your-site-packages-addresss)/django/bin/django-admin.py
Full example for starting project:
python /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/bin/django-admin.py startproject mysite
Upvotes: 0
Reputation: 1345
If you're using windows and needed to update your system path, make sure to close and reopen the command prompt before trying again. I was having a similar problem to you, and this is what fixed it for me.
Upvotes: 0
Reputation: 11
I'm also using Python 2.7 on Mac OS 10.7.x (with Django 1.5.1). I think the tutorial is out of date. Try using "django-admin-2.7.py" command instead of just "django-admin.py," with everything else the same. After more than an hour investigating PATHS and symlinks, etc., this is the solution that worked for me.
Here's the winding road I followed, if you would like to suffer through it for posterity:
python -c "import sys; sys.path = sys.path[1:]; import django; print(django.path)"
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/bin
echo $PATH
), I thought to look in /opt/local/bin instead of usr/local/bin. And lo-and-behold, there was a file called django-admin-2.7.py
. Could it be that I just needed to add the version number to the command in the tutorial?django-admin.py
, I tried django-admin-2.7.py
. It worked!Upvotes: 1
Reputation: 2095
Is django-admin.py on your system path? Checkout: https://code.djangoproject.com/wiki/InstallationPitfalls
Upvotes: 0