问题
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