Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? --> WSGI.PY file

拈花ヽ惹草 提交于 2021-01-07 01:59:46

问题


When I try to execute py manage.py runserver I had the following message:

raise ImportError(

Import Error: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? )

回答1:


I found a lot of possible solutions on the internet. I suggest first try the following:

Go to the wsgi.py file, inside MySite and go to this line:

from django.core.wsgi import get_wsgi_application

Verify that Django is imported. I use Pycharm, the IDE allowed me to import directly from there.

After this I was able to run manage.py



来源:https://stackoverflow.com/questions/65479892/couldnt-import-django-are-you-sure-its-installed-and-available-on-your-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!