【发布时间】:2020-05-17 10:32:35
【问题描述】:
我为 django 创建了一个虚拟环境并尝试启动服务器,但我一直遇到这个问题
(Django-8VqULu7_) C:\Users\rondo11\Documents\learn how to program\learning python\Django>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
ModuleNotFoundError: 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?
有什么问题?
【问题讨论】:
-
最后一行为您提供了可能的解决方案。你确定你在虚拟环境中安装了 Django?
-
您忘记启动虚拟环境。如果您不知道如何创建虚拟环境,请按照以下步骤操作。
标签: python django cmd command-line