Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (19.9k points)

I'm trying to run python manage.py runserver on a Django application I have and I get this error:

Traceback (most recent call last):

File "manage.py", line 8, in <module>

 from django.core.management import execute_from_command_line

ImportError: No module named django.core.management

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

Django==1.6.5

django-cached-authentication-middleware==0.2.0

django-cors-headers==1.1.0

django-htmlmin==0.7.0

django-static-precompiler==0.9

djangorestframework==2.3.14

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

1 Answer

0 votes
by (25.1k points)

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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...