首先说一下python的打包库pyinstaller是真坑,用了一天的时间,始终没找到原因,各种方法都试过,就是不好用,简直是相当顽固!
下面介绍一下报错类型:
cmd报错:raise ImportErrorWhenRunningHook(self.hook_module_name, self.hook_filename)
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_pydoc required by hook for module C:\Users\maxu\AppData\Roaming\Python\Python39\site-packages\PyInstaller\hooks\hook-pydoc.py. Please check whether module __PyInstaller_hooks_0_pydoc actually exists and whether the hook is compatible with your version of C:\Users\maxu\AppData\Roaming\Python\Python39\site-packages\PyInstaller\hooks\hook-pydoc.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.