如何从 Mac 上的 python 文件制作“.exe”文件

How make ".exe" file from python file on Mac

我有 Apple Silicon 上的 MacBook,我需要从 python 文件制作“.exe”文件。 我试过使用 pyinstaller,但它给出了错误:

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyInstaller/utils/osx.py", line 211, in fix_exe_for_code_signing 
    assert linkedit_seg.fileoff + linkedit_seg.filesize == \
AssertionError: Sanity check failed!

如何制作“.exe”文件。我还需要使用多个 python 和其他文件。

.exe 文件仅供 windows 使用。如果您想在 Mac 上制作可执行文件,则必须将其转换为 .app 而不是 .exe。请参阅此视频 - https://www.youtube.com/watch?v=DVOoHL2Bp_o&t=211s .