欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

UnicodeDecodeError: 'utf-8' codec can't decode byte in position : invalid continuation byte

程序员文章站 2022-07-14 10:43:52
...
29703 INFO: Loading module hook "hook-zmq.py"...
----------------------------------------
'utf-8' codec can't decode byte 0xce in position 111: invalid continuation byte
These are the bytes around the offending byte:
----------------------------------------
Traceback (most recent call last):
  File "d:\miniconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\miniconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\miniconda3\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "d:\miniconda3\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "d:\miniconda3\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\Users\MONKEY\Desktop\weixn-autoreply\wechat.spec", line 17, in <module>
    noarchive=False)
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 243, in __init__
    self.__postinit__()
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 502, in assemble
    module_hook.post_graph()
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\imphook.py", line 410, in post_graph
    self._load_hook_module()
  File "d:\miniconda3\lib\site-packages\PyInstaller\building\imphook.py", line 377, in _load_hook_module
    self.hook_module_name, self.hook_filename)
  File "d:\miniconda3\lib\site-packages\PyInstaller\compat.py", line 793, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 907, in load_module
  File "<frozen importlib._bootstrap_external>", line 732, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "d:\miniconda3\lib\site-packages\PyInstaller\hooks\hook-zmq.py", line 18, in <module>
    hiddenimports = ['zmq.utils.garbage'] + collect_submodules('zmq.backend')
  File "d:\miniconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 624, in collect_submodules
    repr(pkg_dir), package))
  File "d:\miniconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 83, in exec_statement
    return __exec_python_cmd(cmd)
  File "d:\miniconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 72, in __exec_python_cmd
    txt = exec_python(*cmd, env=pp_env)
  File "d:\miniconda3\lib\site-packages\PyInstaller\compat.py", line 637, in exec_python
    return exec_command(*cmdargs, **kwargs)
  File "d:\miniconda3\lib\site-packages\PyInstaller\compat.py", line 427, in exec_command
    out = out.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 111: invalid continuation byte

根据最后的提示找到文件:d:\miniconda3\lib\site-packages\PyInstaller\compat.py
UnicodeDecodeError: 'utf-8' codec can't decode byte in position : invalid continuation byte
加上

errors=‘ignore’

即可

相关标签: 乱七八糟