【发布时间】:2020-05-11 20:51:47
【问题描述】:
所以我正在尝试在 Django 中启动一个项目,并根据此处的文档安装了所有内容:https://docs.djangoproject.com/en/3.0/intro/tutorial01/
现在,当我尝试使用命令“py manage.py runserver”运行服务器时,出现以下错误:
Traceback (most recent call last):
File "manage.py", line 10, in main
from django.core.management import execute_from_command_line
ImportError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 16, in main
) from exc
ImportError: 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?
我已经添加了所有必需的环境变量,但我不知道这里有什么问题。任何帮助都会很棒! :)
【问题讨论】:
-
pip install django。如果您有virtual env,请激活它。