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

I was following a tutorial and accordingly I created a app name accounts with this I was proceeding , later I found that name should be ‘accounts’ then I directly renamed it and again I was getting some errors then I deleted that app and created with same name ‘accounts’ from that very moment I am getting these:

Traceback (most recent call last):
File “c:\users\user\appdata\local\programs\python\python37-32\lib\threading.py”, line 917, in _bootstrap_inner
self.run()
File “c:\users\user\appdata\local\programs\python\python37-32\lib\threading.py”, line 865, in run
self._target(*self.args, **self.kwargs)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 64, in wrapper
fn(*args, **kwargs)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\commands\runserver.py”, line 110, in inner_run
autoreload.raise_last_exception()
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 87, in raise_last_exception
raise exception[1]
File "C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management_init
.py", line 375, in execute
autoreload.check_errors(django.setup)()
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django_init
.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\apps\registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\apps\config.py”, line 212, in create
mod = import_module(mod_path)
File "c:\users\user\appdata\local\programs\python\python37-32\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘accounts.app’

Traceback (most recent call last):
File “manage.py”, line 22, in
main()
File “manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management_init_.py”, line 419, in execute_from_command_line
utility.execute()
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management_init_.py”, line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\base.py”, line 354, in run_from_argv
self.execute(*args, **cmd_options)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\commands\runserver.py”, line 61, in execute
super().execute(*args, **options)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\base.py”, line 398, in execute
output = self.handle(*args, **options)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\commands\runserver.py”, line 96, in handle
self.run(**options)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\core\management\commands\runserver.py”, line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 637, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 622, in start_django
reloader.run(django_main_thread)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 328, in run
self.run_loop()
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 334, in run_loop
next(ticker)
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 374, in tick
for filepath, mtime in self.snapshot_files():
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 390, in snapshot_files
for file in self.watched_files():
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 288, in watched_files
yield from iter_all_python_module_files()
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 116, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File “C:\Users\user.virtualenvs\lco-1fbdDC8L\lib\site-packages\django\utils\autoreload.py”, line 152, in iter_modules_and_files
if not path.exists():
File “c:\users\user\appdata\local\programs\python\python37-32\lib\pathlib.py”, line 1318, in exists
self.stat()
File “c:\users\user\appdata\local\programs\python\python37-32\lib\pathlib.py”, line 1140, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: ‘’

(lco-1fbdDC8L) C:\Users\user\Desktop\lco\tubers>

I don’t see a difference between the two names you posted - they both look like accounts to me.

Anyway, deleting apps is one of the most fault-prone operations you can perform with an existing database. If someone wants to delete an app, my general recommendation is that you drop and recreate the database as well. Then do your makemigrations, and then migrate to initialize that fresh database without any leftovers from the deleted app.

You might also want to scan your entire source code for any references to that app in your settings, urls, models, views, or templates; or possible imports or foreign key references that might specify the original app.