Zach Zach - 1 year ago 204
Python Question

ImportError: No module named when using

I'm trying to run

python runserver
on a Django application I have and I get this error:

Traceback (most recent call last):
File "", line 8, in <module>
from import execute_from_command_line
ImportError: No module named

Here is the output of
pip freeze | grep -i django
to show I do in fact have Django installed:


Also, trying to run
/usr/local/bin/python2.7 runserver
yields the same error.

Answer Source

To fix my problem I used the following line in my .zprofile:

export PYTHONPATH=/usr/local/lib/python2.7/site-packages

I was trying to import Django and it couldn't be found, and doing the above solved the issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download