Auto-py-to-exe ожидаемая строка, байты или объект os.PathLike, а не NoneTypePython

Программы на Python
Anonymous
Auto-py-to-exe ожидаемая строка, байты или объект os.PathLike, а не NoneType

Сообщение Anonymous »

Я использую auto-py-to-exe для преобразования моего проекта django в exe-файл, но не смог:
Traceback (most recent call last): File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\auto_py_to_exe\packaging.py", line 132, in package
run_pyinstaller(pyinstaller_args[1:]) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\__main__.py", line 215, in run
run_build(pyi_config, spec_file, **vars(args)) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\__main__.py", line 70, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 1216, in main
build(specfile, distpath, workpath, clean_build) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 1156, in build
exec(code, spec_namespace) File "C:\Users\gerar\AppData\Local\Temp\tmp92y6g42v\manage.spec", line 4, in
a = Analysis(
^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 556, in __init__
self.__postinit__() File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
self.assemble() File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 696, in assemble
program_scripts.append(self.graph.add_script(script))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\analysis.py", line 268, in add_script
self._top_script_node = super().add_script(pathname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1160, in add_script
self._process_imports(n) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2591, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\analysis.py", line 437, in _safe_import_hook
ret_modules = super()._safe_import_hook(
^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2048, in _safe_import_hook
target_modules = self.import_hook(
^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1232, in import_hook
target_package, target_module_partname = self._find_head_package(
^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1411, in _find_head_package
target_package = self._safe_import_module(
^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\analysis.py", line 501, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1792, in _safe_import_module
self._process_imports(n) File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2591, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\analysis.py", line 368, in _safe_import_hook
excluded_imports = self._find_all_excluded_imports(source_module.identifier)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\analysis.py", line 356, in _find_all_excluded_imports
excluded_imports.update(module_hook.excludedimports)
^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\imphook.py", line 316, in __getattr__
self._load_hook_module() File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\depend\imphook.py", line 383, in _load_hook_module
self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\compat.py", line 583, in importlib_load_source
mod_loader.exec_module(mod) File "", line 995, in exec_module File "", line 488, in
_call_with_frames_removed File "C:\Users\gerar\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\hooks\hook-django.py", line 71, in
mod_dir = os.path.dirname(hooks.get_module_file_attribute(mod_name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 277, in dirname File "", line 241, in split TypeError: expected str, bytes or os.PathLike object, not NoneType


Подробнее здесь: https://stackoverflow.com/questions/787 ... t-nonetype

Вернуться в «Python»