pangao1990 / PPX

基于Python和JavaScript,一键生成macOS、Windows和Linux平台客户端应用程序
https://blog.pangao.vip/docs-ppx/
GNU Affero General Public License v3.0
232 stars 39 forks source link

打包的时候报UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 170: invalid start byte #22

Closed 15259291016 closed 1 year ago

15259291016 commented 1 year ago

Traceback (most recent call last): File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\demo\RTUtt\pyenv\pyenv\Scripts\pyinstaller.exe__main.py", line 7, in File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller__main.py", line 194, in _console_script_run run() File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller__main__.py", line 180, in run run_build(pyi_config, spec_file, **vars(args)) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\main__.py", line 61, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 978, in main build(specfile, distpath, workpath, clean_build) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 900, in build exec(code, spec_namespace) File ".\pyapp\spec\windows-pre.spec", line 45, in noarchive=False) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 424, in init self.postinit() File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\datastruct.py", line 173, in postinit__ self.assemble() File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 576, in assemble priority_scripts.append(self.graph.add_script(script)) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 269, in add_script self._top_script_node = super().add_script(pathname) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1434, in add_script self._process_imports(n) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2851, in _process_imports target_modules = self._safe_import_hook(*import_info, kwargs) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 433, in _safe_import_hook return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2515, in _safe_import_hook edge_attr=edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1546, in import_hook target_module, target_attr_names): File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1796, in _import_importable_package_submodules attr_name, submodule_name, package) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 480, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2063, in _safe_import_module self._process_imports(n) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2851, in _process_imports target_modules = self._safe_import_hook(*import_info, *kwargs) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 433, in _safe_import_hook return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2304, in _safe_import_hook target_attr_names=None, level=level, edge_attr=edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1519, in import_hook submodule = self._safe_import_module(head, mname, submodule) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 480, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2063, in _safe_import_module self._process_imports(n) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2851, in _process_imports target_modules = self._safe_import_hook(import_info, kwargs) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 433, in _safe_import_hook return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2304, in _safe_import_hook target_attr_names=None, level=level, edge_attr=edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1519, in import_hook submodule = self._safe_import_module(head, mname, submodule) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 480, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2063, in _safe_import_module self._process_imports(n) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2851, in _process_imports target_modules = self._safe_import_hook(*import_info, **kwargs) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 433, in _safe_import_hook return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2304, in _safe_import_hook target_attr_names=None, level=level, edge_attr=edge_attr) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1519, in import_hook submodule = self._safe_import_module(head, mname, submodule) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\depend\analysis.py", line 480, in _safe_import_module return super()._safe_import_module(module_basename, module_name, parent_package) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2054, in _safe_import_module (module, co) = self._load_module(module_name, pathname, loader) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2144, in _load_module src = loader.get_source(partname) File "", line 783, in get_source File "", line 566, in decode_source UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 170: invalid start byte  ELIFECYCLE  Command failed with exit code 1.

15259291016 commented 1 year ago

用命令 pnpm run start可以跑

15259291016 commented 1 year ago

使用pnpm run pre:winows的时候就会报错

15259291016 commented 1 year ago

是pyinstaller版本的问题 我用5.13.0就没问题了

15259291016 commented 1 year ago

是pyinstaller版本的问题 我用5.13.0就没问题了