如何为 MacOs Big Sur 使用 pyinstaller? [英] How to use pyinstaller for MacOs Big Sur?

查看:91
本文介绍了如何为 MacOs Big Sur 使用 pyinstaller?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小工具.这些是外部库.

I have a small tool. These are the external libraries.

import pyperclip
import webbrowser
import tkinter as tk

我如何使用pyinstaller使其成为macOs桌面应用程序?这是代码.

How could I use pyinstaller to make it a macOs desktop app?This is the code.

推荐答案

PyInstaller当前在Big Sur上存在问题,原因如下:

PyInstaller currently has problem on Big Sur for this reason:

macOS Big Sur 11.0.1中的新增功能,该系统附带内置的动态所有系统提供的库的链接器缓存.作为此更改的一部分,文件系统中不再存在动态库的副本.尝试通过查看来检查动态库是否存在的代码路径中的文件或枚举目录将失败.反而,尝试通过dlopen()路径检查库是否存在,将正确检查缓存中的库.(62986286)

New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

执行pyinstaller时,您会丢失系统库

You'll missing system libraries when you execute pyinstaller

此处进行了一些讨论,但该错误尚未得到修复.(2020年12月21日)

There are some discussing here, but the bug has not been fixed yet. (Dec 21 2020)

作为 pyinstaller文档建议,最好使用旧版本的OSX向前兼容.

As the pyinstaller document suggests, you'd better use old version of the OSX for forward compatible.

只需运行:

pyinstaller --windowed my_code.py

这篇关于如何为 MacOs Big Sur 使用 pyinstaller?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆