From barry at barrys-emacs.org Wed Jun 2 14:26:58 2021 From: barry at barrys-emacs.org (Barry Scott) Date: Wed, 2 Jun 2021 19:26:58 +0100 Subject: [Pythonmac-SIG] Jack Jansen - Question on Python Launcher In-Reply-To: References: Message-ID: <90930808-C1DE-4A94-8AB7-AF564BA23D2C@barrys-emacs.org> > On 30 May 2021, at 18:30, Guy DeStefano wrote: > > > Sorry to bother you, but I have one question that I cannot find an answer to, could you please help. Am very new to Python3 and have written a small program that is my base for my learning Python3. All is perfect except, when I double click my program the .py file, it works great except that it calls in the Python Launcher, and when I exit my program, the preferences box for Python Launcher and the Icon of the launcher still remain on the screen. I have to manually close the python launcher. Can this be done programmatically, I exit with sys.exit(0). I am using tkinter in the program, along with python3.9.5, on an Apple Mac computer. This may not be the proper place for this question, if not, I apologize and please direct me where to go as I have been googling for days. Thanks in advance. Any help will be greatly appreciated. > I have just noticed that python3 -V states python 3.9.5, and looking at the python launcher box it states Version 3.10.0b1(3.10.0b1) Is this something I am doing wrong. I cannot duplicate what you are doing. I have Xcode installed so when I double click a .py file it ends up in the Xcode editor. Unless you have written a GUI app then your python program is expecting to be run from a Terminal window. I'm guessing what what you are seeing is that the python launcher is running your program and keeping the window open so that you can read what it printed. Often new users complain that the Window flash and vanishes before they can read the output. This behaviours looks to be the solution to that common problem. Barry > > guydestefano at gmail.com > Guy DeStefano > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From td at yoma.com.au Wed Jun 2 15:27:05 2021 From: td at yoma.com.au (Tom Dossis) Date: Thu, 3 Jun 2021 05:27:05 +1000 Subject: [Pythonmac-SIG] Jack Jansen - Question on Python Launcher In-Reply-To: References: Message-ID: <683DED73-5DC0-4BFD-B49F-CB523F55C52A@yoma.com.au> Hey Guy, From Finder, right click on your `.py` file, then press the Option key. You should see an ?Always open with?? menu item. From that, select a Python Launcher. A window will then pop up with a customisation dialog. This has an option to ?Run in a Terminal Window?. Good Luck. > On 31 May 2021, at 3:30 am, Guy DeStefano wrote: > > > Sorry to bother you, but I have one question that I cannot find an answer to, could you please help. Am very new to Python3 and have written a small program that is my base for my learning Python3. All is perfect except, when I double click my program the .py file, it works great except that it calls in the Python Launcher, and when I exit my program, the preferences box for Python Launcher and the Icon of the launcher still remain on the screen. I have to manually close the python launcher. Can this be done programmatically, I exit with sys.exit(0). I am using tkinter in the program, along with python3.9.5, on an Apple Mac computer. This may not be the proper place for this question, if not, I apologize and please direct me where to go as I have been googling for days. Thanks in advance. Any help will be greatly appreciated. > I have just noticed that python3 -V states python 3.9.5, and looking at the python launcher box it states Version 3.10.0b1(3.10.0b1) Is this something I am doing wrong. > > guydestefano at gmail.com > Guy DeStefano > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From fishbacp at mail.gvsu.edu Tue Jun 15 17:37:27 2021 From: fishbacp at mail.gvsu.edu (Paul Fishback) Date: Tue, 15 Jun 2021 17:37:27 -0400 Subject: [Pythonmac-SIG] py2app: Can successfully create app with alias mode but version built for deployment returns an error message Message-ID: I'm using Python 3.9 on a Mac running Big Sur and am trying to create an app, MyApplication.app, from a script using py2app. I'm following the process outlined at https://py2app.readthedocs.io/en/latest/tutorial.html . The app itself uses tkinter for creating a GUI. My setup file looks like the following, where 'background.png' is an image that appears on the screen at program startup, and 'pandas' and 'cmath' are included due to previous error messages: from setuptools import setup APP = ['MyApplication_6_14.py'] DATA_FILES = [] OPTIONS = {'resources':['background.png'],'packages': ['pandas','cmath']} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) I can create and run the application in alias mode, and no error messages arise when I build for deployment. However, when I attempt to run the deployed version from the command line via, ./dist/MyApplication.app/Contents/MacOS/MyApplication I receive a fairly lengthy error message below, where Python_May_2021 is the file location: fishbacp at fishbacpK0ML85 Python_May_2021 % ./dist/MyApplication_6_15.app/Contents/MacOS/MyApplication_6_15 Traceback (most recent call last): File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", line 115, in _run() File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", line 84, in _run exec(compile(source, path, "exec"), globals(), globals()) File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/MyApplication_6_15.py", line 6, in import pandas as pd File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/__init__.py", line 179, in import pandas.testing File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/testing.py", line 5, in from pandas._testing import ( File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/_testing.py", line 29, in import pandas._libs.testing as _testing File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing ValueError: source code string cannot contain null bytes I'm curious to know if anyone has insights regarding the last line in the above message. Thanks PaulF -- Professor of Mathematics, Grand Valley State University Past-President, Pi Mu Epsilon National Honorary Mathematics Society, Inc. Department of Mathematics (MAK C-2-408) Grand Valley State University 1 Campus Dr. Allendale, MI 49401 fishbacp at mail.gvsu.edu 616.331.2040 616.331.3120 (fax) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jack.jansen at cwi.nl Thu Jun 17 12:08:37 2021 From: jack.jansen at cwi.nl (jack.jansen at cwi.nl) Date: Thu, 17 Jun 2021 18:08:37 +0200 Subject: [Pythonmac-SIG] py2app: Can successfully create app with alias mode but version built for deployment returns an error message In-Reply-To: References: Message-ID: A quick guess: maybe pandas doesn?t like to be included into a py2app application in this way? I think `.pyx` files are Cython sources, and I think these need to be compiled on installation (which should have happend during py2app?). When you google for ?pandas py2app? you?ll find people reporting similar (but not identical) problems to what you report. But note that some of the stuff google finds is very old, so use your common sense, the world may have changed a lot since the link was written. > On 15 Jun 2021, at 23:37, Paul Fishback wrote: > > I'm using Python 3.9 on a Mac running Big Sur and am trying to create an app, MyApplication.app, from a script using py2app. I'm following the process outlined at https://py2app.readthedocs.io/en/latest/tutorial.html . The app itself uses tkinter for creating a GUI. My setup file looks like the following, where 'background.png' is an image that appears on the screen at program startup, and 'pandas' and 'cmath' are included due to previous error messages: > > from setuptools import setup > > APP = ['MyApplication_6_14.py'] > DATA_FILES = [] > OPTIONS = {'resources':['background.png'],'packages': ['pandas','cmath']} > > setup( > app=APP, > data_files=DATA_FILES, > options={'py2app': OPTIONS}, > setup_requires=['py2app'], > ) > I can create and run the application in alias mode, and no error messages arise when I build for deployment. However, when I attempt to run the deployed version from the command line via, > > ./dist/MyApplication.app/Contents/MacOS/MyApplication > > I receive a fairly lengthy error message below, where Python_May_2021 is the file location: > > fishbacp at fishbacpK0ML85 Python_May_2021 % ./dist/MyApplication_6_15.app/Contents/MacOS/MyApplication_6_15 > Traceback (most recent call last): > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", line 115, in > _run() > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", line 84, in _run > exec(compile(source, path, "exec"), globals(), globals()) > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/MyApplication_6_15.py", line 6, in > import pandas as pd > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/__init__.py", line 179, in > import pandas.testing > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/testing.py", line 5, in > from pandas._testing import ( > File "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/_testing.py", line 29, in > import pandas._libs.testing as _testing > File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing > ValueError: source code string cannot contain null bytes > > I'm curious to know if anyone has insights regarding the last line in the above message. > > Thanks > > PaulF > -- > Professor of Mathematics, Grand Valley State University > Past-President, Pi Mu Epsilon National Honorary Mathematics Society, Inc. > > Department of Mathematics (MAK C-2-408) > Grand Valley State University > 1 Campus Dr. > Allendale, MI 49401 > fishbacp at mail.gvsu.edu > 616.331.2040 > 616.331.3120 (fax) > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From pythonchb at gmail.com Thu Jun 17 15:35:12 2021 From: pythonchb at gmail.com (Christopher Barker) Date: Thu, 17 Jun 2021 12:35:12 -0700 Subject: [Pythonmac-SIG] py2app: Can successfully create app with alias mode but version built for deployment returns an error message In-Reply-To: References: Message-ID: On Thu, Jun 17, 2021 at 9:24 AM wrote: > I think `.pyx` files are Cython sources, > Yes, they are. But Cython is designed to show the source line number when there are errors. So this has been compiled. That error is vaguely familiar to me, I got it recently? I think the fix was to clean out and recompile the Cython files. However, if Pandas is working outside py2app, then it did get built properly. I?d look at the app bundle and see what?s different from the regular install. Ideally, it would copy only the complied modules. -CHB and I think these need to be compiled on installation (which should have > happend during py2app?). > > When you google for ?pandas py2app? you?ll find people reporting similar > (but not identical) problems to what you report. > > But note that some of the stuff google finds is very old, so use your > common sense, the world may have changed a lot since the link was written. > > > > On 15 Jun 2021, at 23:37, Paul Fishback wrote: > > I'm using Python 3.9 on a Mac running Big Sur and am trying to create an > app, MyApplication.app, from a script using py2app. I'm following the > process outlined at https://py2app.readthedocs.io/en/latest/tutorial.html . > The app itself uses tkinter for creating a GUI. My setup file looks like > the following, where 'background.png' is an image that appears on the > screen at program startup, and 'pandas' and 'cmath' are included due to > previous error messages: > > from setuptools import setup > > APP = ['MyApplication_6_14.py'] > DATA_FILES = [] > OPTIONS = {'resources':['background.png'],'packages': ['pandas','cmath']} > > setup( > app=APP, > data_files=DATA_FILES, > options={'py2app': OPTIONS}, > setup_requires=['py2app'], > ) > > I can create and run the application in alias mode, and no error messages > arise when I build for deployment. However, when I attempt to run the > deployed version from the command line via, > > ./dist/MyApplication.app/Contents/MacOS/MyApplication > > I receive a fairly lengthy error message below, where Python_May_2021 is > the file location: > > fishbacp at fishbacpK0ML85 Python_May_2021 % > ./dist/MyApplication_6_15.app/Contents/MacOS/MyApplication_6_15 > Traceback (most recent call last): > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", > line 115, in > _run() > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/__boot__.py", > line 84, in _run > exec(compile(source, path, "exec"), globals(), globals()) > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/MyApplication_6_15.py", > line 6, in > import pandas as pd > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/__init__.py", > line 179, in > import pandas.testing > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/testing.py", > line 5, in > from pandas._testing import ( > File > "/Users/fishbacp/Desktop/Python_May_2021/dist/MyApplication_6_15.app/Contents/Resources/lib/python3.9/pandas/_testing.py", > line 29, in > import pandas._libs.testing as _testing > File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing > ValueError: source code string cannot contain null bytes > > I'm curious to know if anyone has insights regarding the last line in the > above message. > > Thanks > > PaulF > -- > Professor of Mathematics, Grand Valley State University > Past-President, Pi Mu Epsilon National Honorary Mathematics Society, Inc. > > Department of Mathematics (MAK C-2-408) > Grand Valley State University > 1 Campus Dr. > > Allendale, MI 49401 > > fishbacp at mail.gvsu.edu > 616.331.2040 > 616.331.3120 (fax) > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > https://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython -------------- next part -------------- An HTML attachment was scrubbed... URL: From karstenwo at web.de Wed Jun 23 12:24:24 2021 From: karstenwo at web.de (Karsten Wolf) Date: Wed, 23 Jun 2021 18:24:24 +0200 Subject: [Pythonmac-SIG] Python 3.8.7 & pyobjc 6.2.2 MainMenu not loading Message-ID: I'm trying to convert some python2 pyobjc apps to python3. No matter what I do, it does not load MainMenu. Pointers? From karstenwo at web.de Wed Jun 23 13:57:55 2021 From: karstenwo at web.de (Karsten Wolf) Date: Wed, 23 Jun 2021 19:57:55 +0200 Subject: [Pythonmac-SIG] Python 3.8.7 & pyobjc 6.2.2 MainMenu not loading In-Reply-To: References: Message-ID: <29AA7057-46A4-4459-A9D1-545C02F8D757@web.de> I wrote > On 23. Jun 2021, at 18:24, Karsten Wolf wrote: > > I'm trying to convert some python2 pyobjc apps to python3. > > No matter what I do, it does not load MainMenu. > > Pointers? Updating py2app from 0.21 to 0.24 did the trick.