py2app | py2app is a Python setuptools command which will allow you to make standalone Mac OS X application | Map library
kandi X-RAY | py2app Summary
kandi X-RAY | py2app Summary
py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize distutils options
- Determine the runtime
- Reads expected imports from a file
- Returns the runtime preferences
- Check if the built - in package is available
- Scans for bytecode loads
- Get the package name of a node
- Return tk version number
- Emulates the shell environment
- Check if the recipe is valid
- Return the site - packages
- Run the build
- Build an application
- Create a setup py file
- Finalize distutils options
- Return a function that returns a skip function
- Update sys path
- Check wfglade
- Simple example function
- Setup pkg resources
- Called when the window controller is loaded
- Map from source to destination
- Convert source datamodel
- Open file dialog
- Compile the XIB tool to a new one
- Returns the path to the users site
py2app Key Features
py2app Examples and Code Snippets
Community Discussions
Trending Discussions on py2app
QUESTION
I am trying to build an app from a python file (Mac OS) using the py2app extension. I have a folder with the python file and the "setup.py" file.
- I first tested the app by running
python setup.py py2app -A
in the terminal and the dist and build folder are successfully created and the app works when launched. - Now when I try to build it non-locally by running the command
python setup.py py2app
in the terminal, there are various "WARNING: ImportERROR" messages while building and finally aerror: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.8/site-packages/rtree/lib'
error.
How can I fix this? I've tried to delete anaconda fully as I don't use it but it seems to still want to run through it. Additionally, I have tried to run the build command using a virtual environment but I end up having even more import errors.
*I Left out a lot of the "skipping" and "warning" lines using "..." for space
ANSWER
Answered 2022-Mar-13 at 16:13The error error: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.8/site-packages/rtree/lib'
was caused by py2app trying to build the program bundle using a non-existent interpreter. This means that even if you try to uninstall a manager like Anaconda, it still has option logs somewhere on your mac.
The fix:
- Open the terminal and type the command
type -a python
.
- You will see similar lines
QUESTION
I made the app in python and converted it into an app for macos with py2app, on my mac it works correctly but on another mac the error "Error Code: 0x00000004 (no mapping for user data read)" appears. I have already read some articles but they always say to update the app but this solution does not work for me because I made the app, I leave the LOG for you to analyze, thanks. I just discovered that they only allow 30 thousand characters here so I can't upload the full log.
...ANSWER
Answered 2022-Mar-12 at 00:33The "no mapping for user data read" is a common error on mac when running apps. This usually happens if your software version on mac is either outdated or too modern.
Here are the steps I suggest:
- First Check the versions of each mac by clicking the logo in the top left of your mac and selecting "about this mac".
- If the current software version is not the same for each mac, upgrade or downgrade the other mac's software to the one of which the app worked on.
- To upgrade, click the logo in the top left of your mac > system preferences > software update.
- To downgrade, refer to this link
QUESTION
I have written an application using Python code utilizing the Pandas and Openpyxl modules.
Summary of my app: Browse and find an excel file(original), browse and find another excel file(new). Press a button and update certain columns from original file with information of new file using name of item as a reference. Press save button and save the file to my computer.
Using my Windows machine I have made it into an .exe file and everything works perfectly fine. I am able to do everything I created it to do. I am trying to make it compatible on both Windows and MacOS. I have created a .app file using Py2App, and the app "runs" just fine. I am able to browse for files and so far it looks like I am able to save files. The problem is that the files I am trying to "use" are completely greyed out and I am unable to choose any files. I'm fairly new to MacOS so any advice or help would be greatly appreciated.
...ANSWER
Answered 2022-Feb-18 at 19:53Change the file format selector.
QUESTION
Basically, I just want to remove the mouse scrollwheel binding for scrolling in ttk.Treeview widget. And I found that a specific line in the file found in
...ANSWER
Answered 2022-Feb-12 at 05:45You don't have to modify the original code. Tkinter's event handling mechanism is very robust. It's easy to prevent the default bindings from running, bind binding a function that returns the string "break". Returning "break" will prevent any other handlers in the widget's binding tags from being invoked.
Here's a short contrived example:
QUESTION
I'm interested in manually packaging my Python script into a compact and sharable Application.
As a self-taught unexperienced semi-programer I have improvised by writing the following .command-shell-script and put it in a folder along the rest of the .py files from my program:
...ANSWER
Answered 2021-Oct-22 at 10:27You dont have to invent any wheel ... It was invented. There is a standard way for packaging your library.
Follow https://packaging.python.org/tutorials/packaging-projects/
and by the end of the process you will have a library that any onc can install.
QUESTION
[I know this question has been asked multiple times but I am still having trouble finding an option that works for me]
I am using replit.com to write my python code.
I made a program in python, but I want to turn it into an executable application (not a .exe as I am on mac). I saw multiple people use py2app but it doesn't work for me (probably due to the fact I am using an Online IDE). I also tried PyCharm, but when I write: "pip install py2app" to import the package, it just says that it doesn't know the command "pip".
The name of the file is: "main.py"
Here is my code in case it helps (it is pretty messy and confusing):
...ANSWER
Answered 2021-Oct-13 at 00:46Please try to move your code into a new python file on your machine. I don't think it's possible to do this using replit.
You have to download pip for you to do this properly. You can download pip here.
Once you have pip downloaded, you can use the Pyinstaller library to package Python programs as standalone executables. It works on Windows, Linux, and Mac.
Read this answer for more details.
If you want to stick with py2app
, just run pip install py2app
in your terminal once you have pip downloaded.
QUESTION
I have a simple app named determinant_calculator.app that was created using Python 3.9 along with pyinstaller. It functions fine on my own Mac running OS 11.3.1. I want to share it with others outside the App Store. I have an Apple Developer account but I have no experience as a developer nor have I worked with XCode at all. I'm trying to follow the steps given at https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing
I went to the Apple Developer's website and created a certificate, developerID_application.cer, which I downloaded to my desktop. Within Keychain Access, I uploaded the certificate and see it under "My Certificates" as "Developer ID Application: PaulF (47A67S7RBW)"
The bundle contents of determinant_calculator.app contains the info.plist shown here:
...ANSWER
Answered 2021-Oct-08 at 05:28You not only need to codesign your app, you also need to notarize it (as a separate step). If your run the following command in the folder where your app is located, it will send the app to Apple to check. Apple will return a ticket ID. You can then check your notarization history after a few minutes to see if the notarization passed:
Notarization command:
QUESTION
Currently I'm working on a python project (standalone application) which will use some non-python code (js/html). This code is already present in the directory and should therefore be included within the py2app application. I tried out different things to keep these files around so I can access them at runtime in the standalone application.
For the setup.py
I use the following configuration
ANSWER
Answered 2021-Sep-07 at 09:46https://py2app.readthedocs.io/en/latest/options.html#option-reference Lists py2app specific configuration options.
In your case using the “resources” option will help, that will copy files in the application Resources folder.
QUESTION
So I have made this simple Password Manager in Python 3.8 using PyQt5, and I have been using the 'py2app' module to create a standalone application of this program. However, when I execute my app (both from the terminal and the finder), I get a simple popup saying "keysafe Error". My code is executing just fine and has no errors. I can't seem to figure out the problem here. If it helps, I get this message in my macOS logs:
...ANSWER
Answered 2021-May-20 at 22:21So I finally was able to find an answer to this question!
The first thing to do is open your setup.py
file, the default one should look like so:
QUESTION
I have created a python script that helps automate a part of my work on Mac Os VMs. In addition to that it makes use of some other files (some jsons and a few files that need to be copied on the Macos machine in a specific location). Since the script contains also a ui part(via pyqt) I need to pack all files into one app, but I ran into an issue I need the resulting app to ask for Administrative rights when it is ran. I search the internet and the py2app documentation and can't find any info on how to achieve this
any workaround or py2app is not what I need?
...ANSWER
Answered 2021-May-10 at 14:15ended up using "elevate" library. worked like a charm :)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install py2app
You can use py2app like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page