Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError:没有名为';冷漠用户';_Python_Django_Python 3.x_Makemigrations - Fatal编程技术网

Python ModuleNotFoundError:没有名为';冷漠用户';

Python ModuleNotFoundError:没有名为';冷漠用户';,python,django,python-3.x,makemigrations,Python,Django,Python 3.x,Makemigrations,我在vscode上使用django,并在终端上键入: (impassion) Subinui-MacBook-Pro:impassion_community subin$ python3 manage.py makemigrations 但是不能使用makemigrations 收到这个错误消息 ModuleNotFoundError: No module named 'impassionuser' 我怎样才能解决这个问题 我用的是MacOSX,VSCode,django 并设置virtua

我在vscode上使用django,并在终端上键入:

(impassion) Subinui-MacBook-Pro:impassion_community subin$ python3 manage.py makemigrations
但是不能使用makemigrations

收到这个错误消息

ModuleNotFoundError: No module named 'impassionuser'
我怎样才能解决这个问题

我用的是MacOSX,VSCode,django 并设置virtualenv

我希望看到以下消息

Migrations for 'impassionuser':
 impassionuser/migrations/0001_initial.py
 -Create model impassionuser
在settings.py中,我已经添加了“passionuser”

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'impassionuser',
    'board'
]

您是否在admin.py中注册了您的模型

 # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import mymodel


admin.site.register(mymodel)
希望这会有所帮助


还要检查此项

是否已将其安装到虚拟环境中?如果是这样,您需要使用源myvenv/bin/activate激活您的虚拟环境。如果尚未设置虚拟环境,则可能已将模块安装到错误的目录中。确保将模块安装到项目的主目录中。我在终端上写的第一个代码是
pip3 install virtualenv
,然后
virtualenv anicalion
你的应用程序名为anicalionuser吗?如果是,请确保已将其添加到settings.py文件的
INSTALLED_APPS
中。是的,我已将
passionuser
添加到“INSTALLED_APPS”中`