2👍
I had the same problem. I wasn’t in the virtual environment where I installed django crispy forms and then this error occured.
Maybe this can help
1👍
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
I kept getting this same error message after returning to my Django project a few weeks later. I could not trace the exact issues, but I was missing a few packages, namely, crispy_forms and Pillow.
I launched the virtual server using quotes "(path_to_django_project)\Script\activate.bat"
then Enter. Install the missing packages
pip install Pillow
then
pip install crispy-forms-gds
After PIP installing, I run some migrations
python manage.py makemigrations
python manage.py migrate
I started my local server, python manage.py runserver
and view the project in the browser
- [Django]-Django – putting HTML tags inside blocks of text subject to translation
- [Django]-How to integrate Django site and php scripts
- [Django]-How can Django projects be deployed with minimal installation work?
- [Django]-What is the best framework/reusable app for caching model instances (object level cache) in Django?
- [Django]-AssertEqual fails even though the values are the same in python/django
0👍
If You look back in the Terminal, you could find the problem. I had a missing module, called django-filters.
ModuleNotFoundError: No module named 'django_filters'
After I installed it, I got another missing module, and so on. Sometimes, You should restart PyCharm to make it realise the new installations!
Finally, did a
python manage.py makemigrations
then
python manage.py migrate
then
python manage.py runserver
and everything works fine now!
- [Django]-Zsh: command not found: django-admin when starting a django project
- [Django]-Django REST Framework: TestCase is not returning correct queryset
- [Django]-Assigning Backbone templates using Django pipeline similar to Rails JST?
0👍
This is similar to something that happened to me.
After checking the traceback message I’ve noticed the following:
File...
ModuleNotFoundError: No module named '<app_name>'
File...
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
In my specific case I have misspelled the name of the app in settings.py/INSTALLED_APPS
, that’s why the ModuleNotFoundError
.
Django was looking for <app_name>.apps.<app_name>Config
(for instance: blog.apps.BlogConfig
), but I had a typo (like this one: blogg.apps.BlogConfig
) and Django raised an error.
Is Django or Python using the Bootstrap framework?
I’ve seen many answers claim that this error was because you didn’t have the Bootstrap framework installed and that’s wrong.
Let’s see the error again, but in more detail.
File "<...path_to_python...>\lib\importlib\__init__.py", line 127,
in import_module return bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '<app_name>'
File...
OSError: [WinError 123] The filename, directory name, or volume label syntax
is incorrect: '<frozen importlib._bootstrap>'
Is this '<frozen importlib._bootstrap>'
Bootstrap ? Nope.
Let’s see what’s happening in the Python source code.
Apparently the bootstrap reference is not about the CSS framework, but about the import
internals in Python. Like the source code says:
#Lib/importlib/_bootstrap.py
Core implementation of import.
It all starts here, line 127.
return _bootstrap._gcd_import(name[level:], package, level)
0👍
I have the same issue, when I run the project on git-bash terminal.
But when you run it on command prompt the project actually could run.
- [Django]-Django no module named setting
- [Django]-Force a cascading delete for a Django model
- [Django]-Attribute Error: 'dict' object has no attribute 'endswith'
0👍
In my case, the issue resolved after
- python manage.py makemigrations
- python manage.py migrate
- python manage.py runserver
It worked fine after above.
0👍
The same problem happened to me. In my case, I wrote ‘rest-framework’ instead of ‘rest_framework’ in INSTALLED_APPS. Check that too.
- [Django]-Insert more records at once in raw_id_fields
- [Django]-Django custom template tag passing variable number of arguments
- [Django]-"Include" works weirdly
- [Django]-How to ensure idempotency in a Django REST API?