[Django]-OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>' (Django)

71👍

I had the same issue here. After having suffering for a few hours stuck, I figured out the reason. It’s very basic.
We forgot to run the migrate commands.
To fix, run the below commands in order:

python manage.py migrate

python manage.py makemigrations

python manage.py migrate

While the error notification is not relavance but this fix the error anyway :v.

You can read further information about migration Here.

27👍

The same issue is also occurred when someone misspell filename, directory name or app name… for example when someone create an app by the name of users and then he/she want to enlist the app in the INSTALLED_APPS List available in the setting.py file in misspell way like ………… users.app.UsersConfig instead of users.apps.UsersConfig

10👍

if you have virtualenv managing your packages make sure that is activated it before you run your app.

👤Arthur

1👍

I am sensing that you are trying to import bootstrap files for your website.This can be conveniently done by adding the hyperlink from the bootstrap cdn on your base template.
Also you can download the boostrap package and copy the css and js files under the static folder in your project.

1👍

first but not always, it seems you have deleted a file/folder from your project. if so, remember to delete the path that was serving that folder “path in the project urls.py”

0👍

In my case, I was missing the \ when using multiple lines to import:

from .models import Country, State, Locality, Address,\
PercentageAmount, Condominium, Condominium_expenses_report,\
    FunctionalUnit, Percentage, FunctionalUnit_expenses_report,\
        Expense, Bill, Judgment, Insurance, Concept

0👍

I had the same error and I also do not have any bootstrap included in my application. In my case the virtualenv server stopped running. Just reboot the Django server and you are good to go again.

👤JSRB

0👍

I made the same mistake and to solve the issue try this

from django.http import HttpResponse

Leave a comment