ImportError: No module named django.core.management when using manage.py ImportError: No module named django.core.management when using manage.py django django

ImportError: No module named django.core.management when using manage.py


Possible issues that may cause your problem:

  1. PYTHONPATH is not well configured, to configure it you should do:

    export PYTHONPATH=/usr/local/lib/python2.7/site-packages
  2. You forgot the line #!/usr/bin/env python at the beginning of manage.py

  3. If you're working on virtualenv you forgot to activate the virtual env to execute manage.py commands (You may have installed Django on your system but not on your virtualenv)

    source path/to/your/virtualenv/bin/activate

    or

    workon env_name
  4. You have Python 2.7 and Python 3.4 messing with the package

  5. You're using a very old Python 2.4 and you should tell the system to use your Python 2.7 with:

    alias python=python2.7

Some times reinstalling/upgrading Django fix some of those issues.

You may want to execute

python -c "import django; print(django.get_version())"

to check if Django is installed on your PC or your virtualenv if you're using one

You can find some other solutions in other similar questions:


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.


I solved this same error by running the below command:

python3.4 manage.py runserver

And the above command successfully executed for me. So what you can try is, if you are using python 2.7 then just replace 3.4 with 2.7. Hope this helps.