【问题标题】:Pyinstaller gives an error KeyError: 'CALL_FUNCTION'Pyinstaller 给出错误 KeyError: \'CALL_FUNCTION\'
【发布时间】:2022-09-27 22:06:17
【问题描述】:

当我尝试编译我的代码时,我得到了这个错误 我有轮子模块和所有必要的模块 使用代码本身,一切都井井有条,我尝试编译其他程序并遇到相同的错误,我没有找到任何关于此的信息

Traceback (most recent call last):
  File \"<frozen runpy>\", line 198, in _run_module_as_main
  File \"<frozen runpy>\", line 88, in _run_code
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\pyinstaller.exe\\__main__.py\", line 7, in <module>
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\__main__.py\", line 107, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\__main__.py\", line 78, in generate_parser
    import PyInstaller.building.build_main
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\building\\build_main.py\", line 35, in <module>
    from PyInstaller.depend import bindepend
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\bindepend.py\", line 26, in <module>
    from PyInstaller.depend import dylib, utils
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\utils.py\", line 33, in <module>
    from PyInstaller.depend import bytecode
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\bytecode.py\", line 95, in <module>
    _call_function_bytecode = bytecode_regex(rb\"\"\"
                              ^^^^^^^^^^^^^^^^^^^^
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\bytecode.py\", line 60, in bytecode_regex
    pattern = re.sub(
              ^^^^^^^
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\re\\__init__.py\", line 185, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\bytecode.py\", line 62, in <lambda>
    lambda m: _instruction_to_regex(m[1].decode()),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\depend\\bytecode.py\", line 40, in _instruction_to_regex
    return re.escape(bytes([dis.opmap[x]]))
                            ~~~~~~~~~^^^
KeyError: \'CALL_FUNCTION\'

标签: python-3.x compiler-errors pyinstaller


【解决方案1】:

在这里看到同样的东西,似乎与使用Python 3.11(这是预发布)有关。使用 3.10 可以避免这个问题。

【讨论】:

    猜你喜欢
    • 2018-07-02
    • 2016-09-22
    • 2020-01-13
    • 1970-01-01
    • 2017-09-29
    • 2022-01-26
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    相关资源
    最近更新 更多