Question

-bash: django-admin.py: command not found

Posted March 12, 2013 17.5k views
I have done a research but I still don't found the solution. I installed Django, and when I make an import django in python it works. So, what can I do? Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
10 answers

Simply use
python -m django startproject ‘whatever’, or
python3 -m django startproject 'whatever’.
depending on the version you’re using

sudo pip install Django - will solve any errors like this
Have you checked below?

https://code.djangoproject.com/wiki/InstallationPitfalls


All sources point here for this specific issue.
Yeah, I tried this and I still getting the error.
More information to add:
- I installed django via apt-get.
- I have two Python version in the server, previously installed. I didn't installed a new Python version.

Thanks.
is django-admin.py located in your bin folder? /usr/local/bin/django-admin.py

This is the contents of my django-admin.py

#!/usr/bin/python
from django.core import management

if __name__ == "__main__":
management.execute_from_command_line()
Nope, it is not there. Can I uninstall Django with apt and install it downloading it from Django webpage?

And see what happens.
I did what I posted and it works now, it is solved.

Working: http://django.dev-coders.es/
you need install pip
command is : sudo apt-get install python-pip
how install django, is simple
command is: sudo pip install django

Make sure you have installed Django.

Submit an Answer