问题遇到的现象和发生背景
在MacOS中用pycharm给程序打包
问题相关代码,请勿粘贴截图
使用 pyinstaller --add-data="TestForm.ui:." main.py -nTest7 -w -F命令给程序打包
运行结果及报错内容
Traceback (most recent call last):
File "/Users/qinweihua/Desktop/pythonProject/venv1/bin/pyinstaller", line 8, in
sys.exit(run())
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/main.py", line 124, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/main.py", line 58, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 803, in main
build(specfile, distpath, workpath, clean_build)
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 725, in build
exec(code, spec_namespace)
File "/Users/qinweihua/Desktop/pythonProject/Test7.spec", line 40, in
entitlements_file=None )
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/building/api.py", line 510, in init
self.postinit()
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 155, in postinit
self.assemble()
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/building/api.py", line 765, in assemble
pylib_version = osxutils.get_macos_sdk_version(bindepend.get_python_library_path())
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/utils/osx.py", line 97, in get_macos_sdk_version
version_cmd = _find_version_cmd(header)
File "/Users/qinweihua/Desktop/pythonProject/venv1/lib/python3.6/site-packages/PyInstaller/utils/osx.py", line 82, in _find_version_cmd
assert len(version_cmd) == 1, "Expected exactly one LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX command!"
AssertionError: Expected exactly one LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX command!