Python: "bad interpreter: No such file or directory" when running django-admin.py

I'm not sure what you did to produce this error, but the fix for you is to change /usr/local/bin/django-admin.py shebang to #!/usr/bin/env python.


Actually if you install django in a virtualenv, the django-admin.py will have the shebang set to the python interpreter of your virtualenv, but this script will not be created in /usr/local/bin/.

Instead this script will be created in /<virtualenvpath>/bin/ along with activate and the virtualenv python interpreter. You should then move this script to /usr/local/bin/.

Tags:

Python

Django