当我试图使用pyinstaller来创建我的代码的可执行文件时,我会得到这个错误。
AssertionError: /Users/arlinsandbulte/PycharmProjects/Pr07-Media-Sweeper/venv/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so is incompatible with target arch arm64 (has arch: x86_64)!下面是我使用的pyinstaller命令:
pyinstaller "Pro7 Media Sweeper.py" -p ./Pro7-File-API-Python/ -F -w --i resource_files/icons/sweeper.icns --add-data './resource_files:resource_files'发布于 2022-03-05 21:44:50
我想出了办法,至少有个解决办法。我刚刚将选项:--target-arch x86_64添加到pyinstaller命令中。这起作用了!这意味着包是x86_64,需要通过Rosetta运行,而不是作为通用2二进制文件。
https://stackoverflow.com/questions/71362751
复制相似问题