【发布时间】:2020-06-25 22:56:03
【问题描述】:
我正在尝试将一些 python 打包到 MacOS (10.14.5) 上的可执行文件中。我能够创建可执行文件,但执行生成的 dist/hello_world 可执行文件会出现以下错误:
[55240] Error loading Python lib '/var/folders/yh/6_6mb2y96kg0gnb_nh9r2zrr0000gp/T/_MEIwUMw4X/Python': dlopen: dlopen(/var/folders/yh/6_6mb2y96kg0gnb_nh9r2zrr0000gp/T/_MEIwUMw4X/Python, 10): no suitable image found. Did find:
/var/folders/yh/6_6mb2y96kg0gnb_nh9r2zrr0000gp/T/_MEIwUMw4X/Python: code signature invalid for '/var/folders/yh/6_6mb2y96kg0gnb_nh9r2zrr0000gp/T/_MEIwUMw4X/Python'
我的机器正在运行使用从https://www.python.org/ 下载的 Mac 安装程序安装的 Python 3.7.7
目前,我尝试打包的脚本仅包含print('hello world!'),而我使用的打包命令是pyinstaller -F hello_world.py
【问题讨论】:
标签: python python-3.x macos pyinstaller