Reputation: 39
I have a small tool. These are the external libraries.
import pyperclip
import webbrowser
import tkinter as tk
How could I use pyinstaller to make it a macOs desktop app?This is the code.
Upvotes: 3
Views: 25066
Reputation: 1492
PyInstaller currently has problem on Big Sur for this reason:
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)
You'll missing system libraries when you execute pyinstaller
There are some discussing here, but the bug has not been fixed yet. (Dec 21 2020)
As the pyinstaller document suggests, you'd better use old version of the OSX for forward compatible.
Simply run:
pyinstaller --windowed my_code.py
Upvotes: 6
Reputation: 119
The app is being installed in an odd place. If you set up a virtual environment and install it there you will be successful.
Unless you are running Big Sur. Then you will fail because Apple hid some of the dynamically linked libraries and there is not a good workaround right now... 🤬🤬🤬
Upvotes: 0
Reputation: 413
Follow this guide to install pyinstaller on MacOS .
https://pyinstaller.readthedocs.io/en/stable/requirements.html#mac-os-x
after installation, make sure to use pyinstaller --onefile pythonScriptName.py
to create it as single file, else you will have internal package dependencies which will be hard to debug.
Upvotes: 2
Reputation: 400
Simply do:
pyinstaller --windowed <script name>.py
This will create a dist folder with an executable that you can ship to your users.
Upvotes: 1