django - ImportError:在创建数据库时无法导入 Django
问题描述
我正在尝试使用 django 创建数据库,但出现以下错误:
(myvenv) C:\Users\hp\djangogirls>myvenv\Scripts\activate
(myvenv) C:\Users\hp\djangogirls> python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 8, in <module>
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 14, in <module>
) 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 list
,如果您在列表中没有看到Django,请键入pip install django
推荐阅读
- jquery - jQuery ui sortable how to change prev/next item position in table structure
- javascript - Prevent sequelize from soft deleting rows that are referenced somewhere else
- javascript - Is there any possible way to create a "flying" container?
- r - 如何将所有 Linux 环境变量读入 Docker 容器中的 R?
- javascript - 如何通过给定的点标签计算数组?
- python - 通过 python (Py2neo) 将大型数据集转录到 Neo4j
- node.js - 如何在mongoDB中动态添加匹配条件?
- java - 将 Spring HATEOAS 添加到 pom.xml 失败
- php - 在我的脚本完成很久之后,MySQL (RDS) 查询在我的进程列表中运行
- python - 使用 Tensorflow keras.Sequential() 在预测期间激活 dropout