[英]ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable?
i added the python path in environment variable then also it is giving me same error so please anyone can help me我在环境变量中添加了python路径然后它也给了我同样的错误所以请任何人都可以帮助我
(py1) C:\\Users\\NIKITA GULHANE\\projects\\raksh>python manage.py runserver Traceback (most recent call last): File "manage.py", line 8, in from django.core.management import execute_from_command_line File "C:\\Users\\NIKITA~1\\Envs\\py1\\lib\\site-packages\\django__init__.py", line 1, in from django.utils.version import get_version File "C:\\Users\\NIKITA~1\\Envs\\py1\\lib\\site-packages\\django\\utils\\version.py", line 1, in import datetime ModuleNotFoundError: No module named 'datetime'
(py1) C:\\Users\\NIKITA GULHANE\\projects\\raksh>python manage.py runserver Traceback(最近一次调用最后一次):文件“manage.py”,第 8 行,来自 django.core.management import execute_from_command_line 文件“C :\\Users\\NIKITA~1\\Envs\\py1\\lib\\site-packages\\django__init__.py", line 1, in from django.utils.version import get_version File "C:\\Users\\NIKITA~1\\Envs\\py1\\ lib\\site-packages\\django\\utils\\version.py", line 1, in import datetime ModuleNotFoundError: No module named 'datetime'
The above exception was the direct cause of the following exception:上述异常是以下异常的直接原因:
Traceback (most recent call last): File "manage.py", line 14, in ) from exc ImportError: Couldn't import Django.回溯(最近一次通话):文件“manage.py”,第 14 行,来自 exc ImportError:无法导入 Django。 Are you sure it's installed and available on your PYTHONPATH environment variable?
您确定它已安装并在您的 PYTHONPATH 环境变量中可用吗? Did you forget to activate a virtual environment?
您是否忘记激活虚拟环境?
I found you have to ensure Django is imported in the file wsgi.py.我发现您必须确保将 Django 导入到文件 wsgi.py 中。
Hope this answer is useful希望这个回答有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.