ModuleNotFoundError при запуске make-миграций - PullRequest
0 голосов
/ 26 апреля 2020

вот код моих settings.py:

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

для справки: https://imgur.com/a/cbjmrTx

Стек ошибок:

(venv) C: \ Users \ ZinonYT \ PycharmProjects \ CRUD \ library> python manage.py makemigrations


Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\ZinonYT\PycharmProjects\CRUD\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_
line
    utility.execute()
  File "C:\Users\ZinonYT\PycharmProjects\CRUD\venv\lib\site-packages\django\core\management\__init__.py", line 377, in execute
    django.setup()
  File "C:\Users\ZinonYT\PycharmProjects\CRUD\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\ZinonYT\PycharmProjects\CRUD\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\ZinonYT\PycharmProjects\CRUD\venv\lib\site-packages\django\apps\config.py", line 90, in create
    module = import_module(entry)
  File "C:\Users\ZinonYT\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libraryapp'


1 Ответ

0 голосов
/ 26 апреля 2020

Ваша папка libraryapp должна находиться в первой папке библиотеки

┌CRUD
├─library
├──library
└──libraryapp

или просто заменить ваши папки в папке CRUD и удалить одну папку библиотеки

┌CRUD
├─library
└─libraryapp
...