小编A. *_*ine的帖子

在 MacOS 上使用 PyInstaller 加载 Python 库时出错

我正在尝试将一些 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'
Run Code Online (Sandbox Code Playgroud)

我的机器正在运行使用从https://www.python.org/下载的 Mac 安装程序安装的 Python 3.7.7

现在,我试图打包的脚本只包含print('hello world!')我正在使用的打包命令pyinstaller -F hello_world.py

python macos pyinstaller python-3.x

8
推荐指数
1
解决办法
6307
查看次数

标签 统计

macos ×1

pyinstaller ×1

python ×1

python-3.x ×1