django import error - No module named

The Solution to django import error - No module named is

If, like me, you are running your django in a virtualenv, and getting this error, look at your The first line should define the python executable used to run the script. This should be the path to your virtualenv's python, but it is something wrong like /usr/bin/python, which is not the same path and will use the global python environment (and packages will be missing). Just change the path into the path to the python executable in your virtualenv.

You can also replace your shebang line with #!/usr/bin/env python. This should use the proper python environment and interpreter provided that you activate your virtualenv first (I assume you know how to do this).

~ Answered on 2012-05-25 14:42:52

Most Viewed Questions: