gpt4 book ai didi

python - OSError : [WinError 123] The filename, 目录名称或卷标语法不正确: '' 对于 django 项目

转载 作者:行者123 更新时间:2023-12-04 17:19:56 25 4
gpt4 key购买 nike

这是我第一次在这里提交,所以每当我尝试为 Django 项目运行 python manage.py runserver 时,它并没有运行,它给出了一个我以前从未见过的错误


关于这是什么以及如何解决它的任何想法?它给了我以下错误:

我得到的错误

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "D:\GitHub\herafi\manage.py", line 22, in <module>
main()
File "D:\GitHub\herafi\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute
super().execute(*args, **options)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 96, in handle
self.run(**options)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 618, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 603, in start_django
reloader.run(django_main_thread)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 318, in run
self.run_loop()
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 324, in run_loop
next(ticker)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 364, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 380, in snapshot_files
for file in self.watched_files():
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 278, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 105, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1204, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Users\vreoo\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 200, in resolve
return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'

最佳答案

我认为您只是缺少项目文件夹中的 __init__.py 文件。请交叉检查您的项目的 super 文件夹和子文件夹,并确保它是空的 __init__.py 文件是否存在,如果不存在,您需要先创建它。

关于python - OSError : [WinError 123] The filename, 目录名称或卷标语法不正确: '<frozen importlib._bootstrap>' 对于 django 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66781805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com