我是小螃蟹吖~ 2022-12-18 12:10 采纳率: 88.9%
浏览 52
已结题

Pyinstaller的错误

今天我想打包一个文件,pyinstaller报错了,输出内容如下:

Microsoft Windows [版本 10.0.19044.2364]
(c) Microsoft Corporation。保留所有权利。

C:\Users\Administrator>pip install pyinstaller
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting pyinstaller
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/12/a9/91a182d5b2541d8b89396f4371151e412246f8e8d6e65954871548a2a14b/pyinstaller-4.5.1-py3-none-win_amd64.whl (1.9 MB)
Requirement already satisfied: setuptools in d:\program files (x86)\python 3.12.0a2(64-bit)\lib\site-packages (from pyinstaller) (65.5.0)
Collecting altgraph
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/cc/ff/88d277ba936d226b0f6dbd6711145f90fcfeed3aa9455c1c2f62c8ffec5b/altgraph-0.17.3-py2.py3-none-any.whl (21 kB)
Collecting pyinstaller-hooks-contrib>=2020.6
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/32/4b/4a87a98392e0bae03a40932dcfb79896e1cd85af29461ebf82d77ea6778c/pyinstaller_hooks_contrib-2022.14-py2.py3-none-any.whl (252 kB)
     ---------------------------------------- 252.6/252.6 kB 344.8 kB/s eta 0:00:00
Collecting pefile>=2017.8.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/48/30/4559d06bad5bb627733dac1ef28c34f5e35f1461247ba63e5f6366901277/pefile-2022.5.30.tar.gz (72 kB)
  Preparing metadata (setup.py) ... done
Collecting pywin32-ctypes>=0.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9e/4b/3ab2720f1fa4b4bc924ef1932b842edf10007e4547ea8157b0b9fc78599a/pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting future
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829 kB)
     ---------------------------------------- 829.2/829.2 kB 609.4 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Installing collected packages: pywin32-ctypes, altgraph, pyinstaller-hooks-contrib, future, pefile, pyinstaller
  DEPRECATION: future is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for future ... done
  DEPRECATION: pefile is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pefile ... done
Successfully installed altgraph-0.17.3 future-0.18.2 pefile-2022.5.30 pyinstaller-4.5.1 pyinstaller-hooks-contrib-2022.14 pywin32-ctypes-0.2.0

C:\Users\Administrator>pyinstaller
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 107, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 78, in generate_parser
    import PyInstaller.building.build_main
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\building\build_main.py", line 35, in <module>
    from PyInstaller.depend import bindepend
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bindepend.py", line 26, in <module>
    from PyInstaller.depend import dylib, utils
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\utils.py", line 33, in <module>
    from PyInstaller.depend import bytecode
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 95, in <module>
    _call_function_bytecode = bytecode_regex(rb"""
                              ^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 60, in bytecode_regex
    pattern = re.sub(
              ^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\re\__init__.py", line 186, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 62, in <lambda>
    lambda m: _instruction_to_regex(m[1].decode()),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 40, in _instruction_to_regex
    return re.escape(bytes([dis.opmap[x]]))
                     ^^^^^^^^^^^^^^^^^^^^^
ValueError: bytes must be in range(0, 256)

C:\Users\Administrator>color F1

C:\Users\Administrator>cd H:
H:\

C:\Users\Administrator>H:

H:\>pyinstaller -D -w -i LiMing_Image.ico 便捷时钟.py
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 107, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 78, in generate_parser
    import PyInstaller.building.build_main
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\building\build_main.py", line 35, in <module>
    from PyInstaller.depend import bindepend
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bindepend.py", line 26, in <module>
    from PyInstaller.depend import dylib, utils
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\utils.py", line 33, in <module>
    from PyInstaller.depend import bytecode
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 95, in <module>
    _call_function_bytecode = bytecode_regex(rb"""
                              ^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 60, in bytecode_regex
    pattern = re.sub(
              ^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\re\__init__.py", line 186, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 62, in <lambda>
    lambda m: _instruction_to_regex(m[1].decode()),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 40, in _instruction_to_regex
    return re.escape(bytes([dis.opmap[x]]))
                     ^^^^^^^^^^^^^^^^^^^^^
ValueError: bytes must be in range(0, 256)

H:\>pyinstaller -D -w py
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 107, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\__main__.py", line 78, in generate_parser
    import PyInstaller.building.build_main
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\building\build_main.py", line 35, in <module>
    from PyInstaller.depend import bindepend
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bindepend.py", line 26, in <module>
    from PyInstaller.depend import dylib, utils
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\utils.py", line 33, in <module>
    from PyInstaller.depend import bytecode
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 95, in <module>
    _call_function_bytecode = bytecode_regex(rb"""
                              ^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 60, in bytecode_regex
    pattern = re.sub(
              ^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\re\__init__.py", line 186, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 62, in <lambda>
    lambda m: _instruction_to_regex(m[1].decode()),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Program Files (x86)\Python 3.12.0a2(64-bit)\Lib\site-packages\PyInstaller\depend\bytecode.py", line 40, in _instruction_to_regex
    return re.escape(bytes([dis.opmap[x]]))
                     ^^^^^^^^^^^^^^^^^^^^^
ValueError: bytes must be in range(0, 256)

是什么意思啊?
请各位多多指教!

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月30日
  • 已采纳回答 10月22日
  • 创建了问题 12月18日

悬赏问题

  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真
  • ¥15 关于#c语言#的问题,请各位专家解答!