ModuleNotFoundError: No module named 'django'

后端 未结 3 1944
离开以前
离开以前 2021-01-23 02:38

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.

<

相关标签:
3条回答
  • 2021-01-23 03:11

    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.

    0 讨论(0)
  • 2021-01-23 03:14

    Did you follow the instruction on how to edit your wsgi? From the help page:

    Edit your WSGI file

    One thing that's important here: your Django project (if you're using a recent version of Django) will have a file inside it called wsgi.py. This is not the one you need to change to set things up on PythonAnywhere -- the system here ignores that file.

    Instead, the WSGI file to change is the one that has a link inside the "Code" section of the Web tab -- it will have a name something like /var/www/yourusername_pythonanywhere_com_wsgi.py or /var/www/www_yourdomain_com_wsgi.py.

    0 讨论(0)
  • 2021-01-23 03:14

    This might be answered many times, but recently I upgraded my ubuntu 18.04 to 19.10, and without changing any other thing, my running django server stopped running with this error: ModuleNotFoundError: No module named 'django'. I repeated the same install, python3 -m pip install django and it didn't help. Finally somebody else told me to use

    sudo python3 -m pip install django

    because I run the server with sudo python3 manage.py runserver 0.0.0.0:80, which actually worked for me.

    0 讨论(0)
提交回复
热议问题