From tim at shead-custom-design.com Sat Dec 12 22:53:40 2020 From: tim at shead-custom-design.com (Timothy M. Shead) Date: Sat, 12 Dec 2020 20:53:40 -0700 Subject: [Pythonmac-SIG] py2app questions Message-ID: Many thanks for py2app, of all the packaging apps I?ve tried, it?s been the most usable by far; that said, I have questions. Using conda, python 3.8.5, and py2app 0.22 on MacOS 10.15.7 with the following test app: # hello.py print(?Hello, World!?) And the following default setup.py: from setuptools import setup APP = ["hello.py?] DATA_FILES = [] OPTIONS = {} setup( app=APP, data_files=DATA_FILES, options={"py2app": OPTIONS}, setup_requires=["py2app?], ) Everything builds and runs fine: $ python setup.py py2app $ dist/hello.app/Contents/MacOS/hello Hello, World! However, upon closer inspection, I see that there are a couple of libs that are being loaded from outside the bundle: $ DYLD_PRINT_LIBRARIES=1 dist/hello.app/Contents/MacOS/hello ... /Users/tshead/miniconda3/envs/flow/lib/libz.1.dylib /Users/tshead/miniconda3/envs/flow/lib/libffi.7.dylib Focusing on libz, I see that it?s being loaded from a library that is part of the bundle: $ otool -L dist/hello.app/Contents/Resources/lib/python3.8/lib-dynload/zlib.so dist/hello.app/Contents/Resources/lib/python3.8/lib-dynload/zlib.so: @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) ? And when I look at the main executable, the second rpath looks questionable: $ otool -l dist/hello.app/Contents/MacOS/hello ? Load command 16 cmd LC_RPATH cmdsize 32 path @loader_path/../lib (offset 12) Load command 17 cmd LC_RPATH cmdsize 48 path @loader_path/../../../../../ (offset 12) What is the right approach to address this? Manually copy the missing .dylib files into dist/hello.app/Contents/lib? I?m too new to know what to expect from py2app, but I?m surprised that it would be necessary for something as ubiquitous as zlib? Cheers, Tim From ronaldoussoren at mac.com Mon Dec 14 03:21:50 2020 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 14 Dec 2020 09:21:50 +0100 Subject: [Pythonmac-SIG] py2app questions In-Reply-To: References: Message-ID: > On 13 Dec 2020, at 04:53, Timothy M. Shead wrote: > > Many thanks for py2app, of all the packaging apps I?ve tried, it?s been the most usable by far; that said, I have questions. Using conda, python 3.8.5, and py2app 0.22 on MacOS 10.15.7 with the following test app: > > # hello.py > print(?Hello, World!?) > > And the following default setup.py: > > from setuptools import setup > > APP = ["hello.py?] > DATA_FILES = [] > OPTIONS = {} > > setup( > app=APP, > data_files=DATA_FILES, > options={"py2app": OPTIONS}, > setup_requires=["py2app?], > ) > > Everything builds and runs fine: > > $ python setup.py py2app > $ dist/hello.app/Contents/MacOS/hello > Hello, World! > > However, upon closer inspection, I see that there are a couple of libs that are being loaded from outside the bundle: > > $ DYLD_PRINT_LIBRARIES=1 dist/hello.app/Contents/MacOS/hello > ... > /Users/tshead/miniconda3/envs/flow/lib/libz.1.dylib > /Users/tshead/miniconda3/envs/flow/lib/libffi.7.dylib > > Focusing on libz, I see that it?s being loaded from a library that is part of the bundle: > > $ otool -L dist/hello.app/Contents/Resources/lib/python3.8/lib-dynload/zlib.so > dist/hello.app/Contents/Resources/lib/python3.8/lib-dynload/zlib.so: > @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) > ? How was Python build? > > And when I look at the main executable, the second rpath looks questionable: > > $ otool -l dist/hello.app/Contents/MacOS/hello > ? > Load command 16 > cmd LC_RPATH > cmdsize 32 > path @loader_path/../lib (offset 12) > Load command 17 > cmd LC_RPATH > cmdsize 48 > path @loader_path/../../../../../ (offset 12) Was this file created by py2app, or did you change it afterwards? The stub executable in current releases of py2app should not contain LC_RPATH entries at all. > > What is the right approach to address this? Manually copy the missing .dylib files into dist/hello.app/Contents/lib? I?m too new to know what to expect from py2app, but I?m surprised that it would be necessary for something as ubiquitous as zlib? Py2app, or rather the macholib library used by py2app, does not process @rpath correctly. The code is older than the introduction of this feature and is not easily adjusted for it because some information needed for correctly dealing with @rpath and @loader_path is lost before the code that should use the information is active. I have rewriting that code on my too long todo list. Note that this works for me, with the Python.org installation of Python. Ronald ? Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ > > Cheers, > Tim > > _______________________________________________ > 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 tim at shead-custom-design.com Tue Dec 15 02:19:10 2020 From: tim at shead-custom-design.com (Timothy M. Shead) Date: Tue, 15 Dec 2020 00:19:10 -0700 Subject: [Pythonmac-SIG] py2app questions In-Reply-To: References: Message-ID: <6B625CEC-C584-4503-AC36-F38E84B105D8@shead-custom-design.com> > On Dec 14, 2020, at 1:21 AM, Ronald Oussoren wrote: > > How was Python build? The Python executable and all dependencies are installed using Conda: Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin >> And when I look at the main executable, the second rpath looks questionable: >> >> $ otool -l dist/hello.app/Contents/MacOS/hello >> ? >> Load command 16 >> cmd LC_RPATH >> cmdsize 32 >> path @loader_path/../lib (offset 12) >> Load command 17 >> cmd LC_RPATH >> cmdsize 48 >> path @loader_path/../../../../../ (offset 12) > > Was this file created by py2app, or did you change it afterwards? The stub executable in current releases of py2app should not contain LC_RPATH entries at all. This is the executable built by py2app, with no meddling from me: $ rm -rf build dist $ python setup.py py2app $ otool -l dist/hello.app/Contents/MacOS/hello >> What is the right approach to address this? Manually copy the missing .dylib files into dist/hello.app/Contents/lib? I?m too new to know what to expect from py2app, but I?m surprised that it would be necessary for something as ubiquitous as zlib? > > Py2app, or rather the macholib library used by py2app, does not process @rpath correctly. The code is older than the introduction of this feature and is not easily adjusted for it because some information needed for correctly dealing with @rpath and @loader_path is lost before the code that should use the information is active. I have rewriting that code on my too long todo list. > > Note that this works for me, with the Python.org installation of Python. Many thanks, Tim From pythonchb at gmail.com Tue Dec 15 12:17:50 2020 From: pythonchb at gmail.com (Christopher Barker) Date: Tue, 15 Dec 2020 09:17:50 -0800 Subject: [Pythonmac-SIG] py2app questions In-Reply-To: <6B625CEC-C584-4503-AC36-F38E84B105D8@shead-custom-design.com> References: <6B625CEC-C584-4503-AC36-F38E84B105D8@shead-custom-design.com> Message-ID: On Mon, Dec 14, 2020 at 11:28 PM Timothy M. Shead < tim at shead-custom-design.com> wrote: > > How was Python build? > > The Python executable and all dependencies are installed using Conda: > > Python 3.8.5 (default, Sep 4 2020, 02:22:02) > [Clang 10.0.0 ] :: Anaconda, Inc. on darwin > Note that the conda build of Python on OS-X is a "plain *nix" build. which may be the source of your issues. I'm not sure what the difference is other than the app bundle wrapper (pythonw), but I wouldn't be supposed if there's a difference that will break py2app. HTH, -CHB > >> And when I look at the main executable, the second rpath looks > questionable: > >> > >> $ otool -l dist/hello.app/Contents/MacOS/hello > >> ? > >> Load command 16 > >> cmd LC_RPATH > >> cmdsize 32 > >> path @loader_path/../lib (offset 12) > >> Load command 17 > >> cmd LC_RPATH > >> cmdsize 48 > >> path @loader_path/../../../../../ (offset 12) > > > > Was this file created by py2app, or did you change it afterwards? The > stub executable in current releases of py2app should not contain LC_RPATH > entries at all. > > This is the executable built by py2app, with no meddling from me: > > $ rm -rf build dist > $ python setup.py py2app > $ otool -l dist/hello.app/Contents/MacOS/hello > > >> What is the right approach to address this? Manually copy the missing > .dylib files into dist/hello.app/Contents/lib? I?m too new to know what to > expect from py2app, but I?m surprised that it would be necessary for > something as ubiquitous as zlib? > > > > Py2app, or rather the macholib library used by py2app, does not process > @rpath correctly. The code is older than the introduction of this feature > and is not easily adjusted for it because some information needed for > correctly dealing with @rpath and @loader_path is lost before the code that > should use the information is active. I have rewriting that code on my too > long todo list. > > > > Note that this works for me, with the Python.org installation of Python. > > Many thanks, > Tim > > _______________________________________________ > 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 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 tim at shead-custom-design.com Wed Dec 16 20:35:24 2020 From: tim at shead-custom-design.com (Timothy M. Shead) Date: Wed, 16 Dec 2020 18:35:24 -0700 Subject: [Pythonmac-SIG] py2app questions In-Reply-To: References: <6B625CEC-C584-4503-AC36-F38E84B105D8@shead-custom-design.com> Message-ID: <1B9F0408-5567-4B9D-B9BF-9ACAA7784F62@shead-custom-design.com> > On Dec 15, 2020, at 10:17 AM, Christopher Barker wrote: > > On Mon, Dec 14, 2020 at 11:28 PM Timothy M. Shead > wrote: > > How was Python build? > > The Python executable and all dependencies are installed using Conda: > > Python 3.8.5 (default, Sep 4 2020, 02:22:02) > [Clang 10.0.0 ] :: Anaconda, Inc. on darwin > > Note that the conda build of Python on OS-X is a "plain *nix" build. which may be the source of your issues. I'm not sure what the difference is other than the app bundle wrapper (pythonw), but I wouldn't be supposed if there's a difference that will break py2app. I didn?t know there was a difference. Thanks for the heads-up! Cheers, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From guido54321 at gmail.com Tue Dec 29 13:29:25 2020 From: guido54321 at gmail.com (Guido Deboeck) Date: Tue, 29 Dec 2020 13:29:25 -0500 Subject: [Pythonmac-SIG] Using Python on Mac Message-ID: In Lesson 2 of Python and Arduino by Paul McWhorter he suggest downloading Python 2.7 rather than the more recent version 3.x. He also suggests to download pyserial 2.7 as well as vPhython. I have search for pyserial 2.7 and have not been able to find it on the web As to vPhython I found PyCharm, but that is not for free. Could you pls help me to find pyserial 2.7 as well as vPhython for use on a Mac. Thank you. From jack.jansen at cwi.nl Wed Dec 30 06:50:55 2020 From: jack.jansen at cwi.nl (Jack Jansen) Date: Wed, 30 Dec 2020 12:50:55 +0100 Subject: [Pythonmac-SIG] Using Python on Mac In-Reply-To: References: Message-ID: Guido, if I googled correctly that ?Python and Arduino? series is from 2014. At that time there was something to be said for using Python 2.7, but in 2020 that is no longer true. And, actually, since Python 2.7 has finally been moved to end-of-life last year many tutorials that refer to Python 2.7 specifically will stop to work (as you have found out). Your best bet is to ignore all the version numbers Paul McWorther mentions in his tutorial, and try to download the latest version of everything. See how far that gets you. You?re not the first one to run into this problem, as you can see from the comments under the video, but unfortunately none of the people that came across the Python 2.7 issues added comments saying what they had to do to run the tutorial in 2020. If you get it to work: maybe add a comment to the video to say what you had to change to make it work? And feel free to post problems here, Jack > On 29-Dec-2020, at 19:29 , Guido Deboeck wrote: > > In Lesson 2 of Python and Arduino by Paul McWhorter he suggest downloading Python 2.7 rather than the more recent version 3.x. He also suggests to download pyserial 2.7 as well as vPhython. I have search for pyserial 2.7 and have not been able to find it on the web As to vPhython I found PyCharm, but that is not for free. Could you pls help me to find pyserial 2.7 as well as vPhython for use on a Mac. Thank you. > > _______________________________________________ > 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 -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Wed Dec 30 07:08:17 2020 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 30 Dec 2020 13:08:17 +0100 Subject: [Pythonmac-SIG] [ANN] PyObjC 7.1 Message-ID: <5BD76406-9A59-468F-AA4E-DE1FD9D21782@mac.com> Hi, I?ve uploaded PyObjC 7.1 to PyPI. The most important change is support for API?s introduced in macOS 11.1. Other than that there was a change to make it easier to build with the Command Line Tools instead of Xcode (for those not using the binary wheels). Ronald ? Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pythonchb at gmail.com Wed Dec 30 18:15:47 2020 From: pythonchb at gmail.com (Christopher Barker) Date: Wed, 30 Dec 2020 15:15:47 -0800 Subject: [Pythonmac-SIG] Using Python on Mac In-Reply-To: References: Message-ID: it looks like vPython (I'm assuming vPhython was a typo) is fairly up to date: https://vpython.org/presentation2018/install.html as is pyserial: https://pypi.org/project/pyserial/#history I would go with vPython's advise to use conda to get both vPython and pyserial. -CHB (note: I recommend "miniconda" -- and then install exactly what else you need) On Wed, Dec 30, 2020 at 3:51 AM Jack Jansen wrote: > Guido, > if I googled correctly that ?Python and Arduino? series is from 2014. At > that time there was something to be said for using Python 2.7, but in 2020 > that is no longer true. And, actually, since Python 2.7 has finally been > moved to end-of-life last year many tutorials that refer to Python 2.7 > specifically will stop to work (as you have found out). > > Your best bet is to ignore all the version numbers Paul McWorther mentions > in his tutorial, and try to download the latest version of everything. See > how far that gets you. > > You?re not the first one to run into this problem, as you can see from the > comments under the video, but unfortunately none of the people that came > across the Python 2.7 issues added comments saying what they had to do to > run the tutorial in 2020. If you get it to work: maybe add a comment to the > video to say what you had to change to make it work? > > And feel free to post problems here, > > Jack > > On 29-Dec-2020, at 19:29 , Guido Deboeck wrote: > > In Lesson 2 of Python and Arduino by Paul McWhorter he suggest downloading > Python 2.7 rather than the more recent version 3.x. He also suggests to > download pyserial 2.7 as well as vPhython. I have search for pyserial 2.7 > and have not been able to find it on the web As to vPhython I found > PyCharm, but that is not for free. Could you pls help me to find pyserial > 2.7 as well as vPhython for use on a Mac. Thank you. > > _______________________________________________ > 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 > > > -- > > Jack Jansen, , http://www.cwi.nl/~jack > > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > > _______________________________________________ > 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 Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython -------------- next part -------------- An HTML attachment was scrubbed... URL: