【发布时间】:2019-10-31 19:16:29
【问题描述】:
当我输入时
python manage.py runserver
在 windows powershell 上,django 服务器工作正常,但是当我尝试在 pycharm 上运行 django 服务器时,服务器没有连接并给出这个错误
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?
。如何解决此错误?
这是快照https://i.stack.imgur.com/dEzUW.png
【问题讨论】:
-
使用 pycharm 安装 django。
标签: django python-3.x