简体   繁体   English

Django / makemigrations ModuleNotFoundError:没有名为“idmp_core.apps.IdmpCoreConfigdjango”的模块;

[英]Django / makemigrations ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango';

I'm learning Django... And there is an error I'm not able to fix when running makemigrations command.我正在学习 Django...并且在运行makemigrations命令时有一个我无法修复的错误。

I got the error ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package我收到错误ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package . ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package What is puzzling me is the django word appened at the end of idmp_core.apps.IdmpCoreConfig string that is part of令我困惑的是idmp_core.apps.IdmpCoreConfig字符串末尾idmp_core.apps.IdmpCoreConfigdjango词,它是

INSTALLED_APPS = [
    'idmp_core.apps.IdmpCoreConfig'
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

My project tree structure is the following one:我的项目树结构如下:

D:.
|   manage.py
|   
+---idmp_core
|   |   admin.py
|   |   apps.py
|   |   models.py
|   |   tests.py
|   |   urls.py
|   |   views.py
|   |   __init__.py
|   |   
|   +---migrations
|   |       __init__.py
|           
+---idmp_v0
|   |   settings.py
|   |   urls.py
|   |   wsgi.py
|   |   __init__.py
|           
\---templates

I created the idmp_core using python manage.py startapp idmp_core and that went well.我使用python manage.py startapp idmp_core创建了idmp_core并且进展顺利。

I modified the models.py of idmp_core directory.我修改了idmp_core目录的models.py And when I run the command当我运行命令时

python manage.py makemigrations idmp_core

I get following error message我收到以下错误消息

(idmp) D:\Dropbox\mycode\idmp_v0>python manage.py makemigrations idmp_core
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\core\management\__init__.py", line 347, in execute
    django.setup()
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\apps\registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "C:\Users\JMERX\Envs\idmp\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package

When I followed a Django tutorial, everything was fine.当我遵循 Django 教程时,一切都很好。 I did a mistake... But I'm not able to understand where...我犯了一个错误......但我无法理解在哪里......

You just forgot to put a comma in there你只是忘了在那里放一个逗号

Here you go干得好

INSTALLED_APPS = [
    'idmp_core.apps.IdmpCoreConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

I'm learning Django... And there is an error I'm not able to fix when running makemigrations command.我正在学习Django ...并且运行makemigrations命令时出现无法修复的错误。

I got the error ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package我收到错误ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package . ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package What is puzzling me is the django word appened at the end of idmp_core.apps.IdmpCoreConfig string that is part of令我感到困惑的是在单词idmp_core.apps.IdmpCoreConfig字符串的末尾添加的django词,它是

INSTALLED_APPS = [
    'idmp_core.apps.IdmpCoreConfig'
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

My project tree structure is the following one:我的项目树结构如下:

D:.
|   manage.py
|   
+---idmp_core
|   |   admin.py
|   |   apps.py
|   |   models.py
|   |   tests.py
|   |   urls.py
|   |   views.py
|   |   __init__.py
|   |   
|   +---migrations
|   |       __init__.py
|           
+---idmp_v0
|   |   settings.py
|   |   urls.py
|   |   wsgi.py
|   |   __init__.py
|           
\---templates

I created the idmp_core using python manage.py startapp idmp_core and that went well.我使用python manage.py startapp idmp_core创建了idmp_core ,一切顺利。

I modified the models.py of idmp_core directory.我修改了idmp_core目录的models.py And when I run the command当我运行命令时

python manage.py makemigrations idmp_core

I get following error message我收到以下错误消息

(idmp) D:\Dropbox\mycode\idmp_v0>python manage.py makemigrations idmp_core
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\core\management\__init__.py", line 347, in execute
    django.setup()
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\apps\registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\JMERX\Envs\idmp\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "C:\Users\JMERX\Envs\idmp\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'idmp_core.apps.IdmpCoreConfigdjango'; 'idmp_core.apps' is not a package

When I followed a Django tutorial, everything was fine.当我遵循Django教程时,一切都很好。 I did a mistake... But I'm not able to understand where...我犯了一个错误...但是我不明白在哪里...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 makemigrations ModuleNotFoundError:没有名为 Insta 的模块 - makemigrations ModuleNotFoundError: No module named Insta ModuleNotFoundError:没有名为“django.core”的模块 - ModuleNotFoundError: No module named 'django.core' ModuleNotFoundError:没有名为“madlibs_project”的模块 django.core.exceptions.AppRegistryNotReady:尚未加载应用程序 - ModuleNotFoundError: No module named 'madlibs_project' django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet 带有Django的Pyinstaller:ModuleNotFoundError:没有名为“ django.contrib.admin.apps”的模块 - Pyinstaller with Django: ModuleNotFoundError: No module named 'django.contrib.admin.apps' ModuleNotFoundError:在尝试 &gt;Python manage.py makemigrations|python 3.7、django 2.1.7 时没有名为“DEGNet”的模块 - ModuleNotFoundError: No module named 'DEGNet' while attempting >Python manage.py makemigrations|python 3.7, django 2.1.7 带有Django的Pyinstaller:ModuleNotFoundError:没有名为django.contrib.messages.apps的模块 - Pyinstaller with Django: ModuleNotFoundError: No Module Named django.contrib.messages.apps ModuleNotFoundError: 没有名为 &#39;django 的模块 - ModuleNotFoundError: No module named 'django ModuleNotFoundError:没有名为“django”的模块 - ModuleNotFoundError: No module named 'django' ModuleNotFoundError: 没有名为“django”的模块 - ModuleNotFoundError: No module named ' django' ModuleNotFoundError:Django 中没有名为“tensorflow_core.keras”的模块 - ModuleNotFoundError: No module named 'tensorflow_core.keras' in Django
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM