ModuleNotFoundError: No module named 'django'

Pierino picture Pierino · Sep 25, 2017 · Viewed 14.3k times · Source

I'm trying make online a project but there is an error i can't solve myself. I already installed django but the server give me this error. Virtualenv is also active.

Wsgi file is it:

    import os
import sys


path = '/home/asd1/mysite'
if path not in sys.path:
    sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Hosting is pythonanywhere.com

Answer

montudor picture montudor · Sep 25, 2017

You need to install Django. You may have forgotten to install it while the environment was active.

You can learn how to do this here.

This also could be because you have called your project a name such as "django" which would conflict with the installed packages.