杨逍6 2022-09-24 15:13 采纳率: 0%
浏览 62

pyinstaller 打包exe报错

问题遇到的现象和发生背景

pyinstaller 打包exe报错

用代码块功能插入代码,请勿粘贴截图
a = 1
print(a)

运行结果及报错内容
D:\Desktop\编程>pyinstaller -F 练习模式.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:\Python\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "D:\Python\Lib\site-packages\PyInstaller\__main__.py", line 107, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "D:\Python\Lib\site-packages\PyInstaller\__main__.py", line 78, in generate_parser
    import PyInstaller.building.build_main
  File "D:\Python\Lib\site-packages\PyInstaller\building\build_main.py", line 35, in <module>
    from PyInstaller.depend import bindepend
  File "D:\Python\Lib\site-packages\PyInstaller\depend\bindepend.py", line 26, in <module>
    from PyInstaller.depend import dylib, utils
  File "D:\Python\Lib\site-packages\PyInstaller\depend\utils.py", line 33, in <module>
    from PyInstaller.depend import bytecode
  File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 95, in <module>
    _call_function_bytecode = bytecode_regex(rb"""
                              ^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 60, in bytecode_regex
    pattern = re.sub(
              ^^^^^^^
  File "D:\Python\Lib\re\__init__.py", line 185, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 62, in <lambda>
    lambda m: _instruction_to_regex(m[1].decode()),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Lib\site-packages\PyInstaller\depend\bytecode.py", line 40, in _instruction_to_regex
    return re.escape(bytes([dis.opmap[x]]))
                            ~~~~~~~~~^^^
KeyError: 'CALL_FUNCTION'


我的解答思路和尝试过的方法

尝试过不同代码和不同文件命名, 也重新安装过pyinstaller . 感觉问题出在了pyinstaller上.

我想要达到的结果

将py文件打包成exe

  • 写回答

2条回答 默认 最新

  • 亖夕 Python领域新星创作者 2022-09-24 15:49
    关注

    看看你要打包的py文件,或者连带打包的其他文件

    评论

报告相同问题?

问题事件

  • 创建了问题 9月24日

悬赏问题

  • ¥30 为什么会失败呢,该如何调整
  • ¥50 如何在不能联网影子模式下的电脑解决usb锁
  • ¥20 服务器redhat5.8网络问题
  • ¥15 如何利用c++ MFC绘制复杂网络多层图
  • ¥20 要做柴油机燃烧室优化 需要保持压缩比不变 请问怎么用AVL fire ESE软件里面的 compensation volume 来使用补偿体积来保持压缩比不变
  • ¥15 python螺旋图像
  • ¥15 算能的sail库的运用
  • ¥15 'Content-Type': 'application/x-www-form-urlencoded' 请教 这种post请求参数,该如何填写??重点是下面那个冒号啊
  • ¥15 找代写python里的jango设计在线书店
  • ¥15 请教如何关于Msg文件解析