I've googled the hell out of this, but all of the solutions I've found seem to solve problems that are not mine.
I created a project in a virtual environment in /Users/[user]/Documents/projects/[project]
using virtualenv
and installed Django.
Later, I deleted that project and installed Django on my system outside of the virtual environment. Now, I am trying to run this:
django-admin.py startproject mysite
However, I am receiving this error message:
-bash: /usr/local/bin/django-admin.py:
/Users/[user]/Documents/projects/[project]/bin/python:
bad interpreter: No such file or directory
I have found that the only way I can make this work again is by setting up the [project] virtual environment as I had it before with Django installed in it.
How do I fix this?
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/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With