From ben.bw at me.com Tue May 2 07:47:42 2017 From: ben.bw at me.com (Ben Byram-Wigfield) Date: Tue, 02 May 2017 12:47:42 +0100 Subject: [Pythonmac-SIG] PyObjC - Apple sample code In-Reply-To: References: <91AD7D8E-3FC2-411D-A632-9E3FD93BB1EF@me.com> <98C40132-7FF6-4C35-BF04-28603AFC3646@me.com> <005E6357-8336-4F6C-803D-52E2E09B00F7@twistedmatrix.com> Message-ID: <27ADFE2C-C931-4EBB-BEFD-20E321DEBEEC@me.com> I reinstalled python 2.7.13 from a fresh downloaded .pkg, and used pip to reinstall PyObjC, but I still get the same errors. Do the Quartz example scripts work on python 3 ? Ben > On 29 Apr 2017, at 05:57, Christopher Barker wrote: > > And you really don't want to use easy_install amymore, either. Try pip. > > I see the appeal of an Apple-supplied python, but Apple has never properly supported it ever since OS-X 10.1..... > > -CHB > > > > > On Fri, Apr 28, 2017 at 5:19 PM Glyph > wrote: > Relying on the system Python for this sort of stuff has always guaranteed you'd have an out-of-date version of all of your dependencies. > > The availability of wheels (thanks again Ronald!!!) for pyobjc means that you don't need the biggest impediment to users installing stuff, which is a C compiler. If you're building stuff for distribution to non-technical folks, build it with your own version of python (3) and ship it with py2app, not by copying scripts around. > > If there are things that make this more painful than just copying individual scripts, it's probably best to figure out how to get those addressed with the PyPA community. > > -glyph > > > On Apr 28, 2017, at 4:20 AM, Ben Byram-Wigfield > wrote: > > > > I ran the installer package for the latest python 2.7, and then used easy_install to install PyObjC. > > I get the same errors on two separate Macs. What should I do to fix the installation? > > > > Does Apple not have plans to include (all of) the latest PyObjC? That?s rather sad. The reason I was attracted to creating ObjC python scripts was that they could run on any Mac. > > > > Thanks > > > > Ben > > > > > >> On 28 Apr 2017, at 08:07, Ronald Oussoren > wrote: > >> > >> > >>> On 27 Apr 2017, at 10:17, Ben Byram-Wigfield > wrote: > >>> > >>> I tried the repository browser there, and the version of parse_page_contents.py still doesn?t work for me. I?m using the latest downloaded versions of python 2.7 and PyObjC. I also tried using the default OS X versions. > >>> The errors are in the attached file. > >>> > >> The PyObjC 3.2 error at the top of the file seems to indicate that your Python installation is broken, PyObjC imports the stdlib io module and that causes and error. > >> > >> The PyObjC 2.5 error is due to general brokeness of the system installation of PyObjC. PyObjC 2.5 is ancient and not something I support anymore, furthermore (IIRC) Apple doesn?t ship all of PyObjC. The error you?re getting indicates that the framework wrappers are incomplete. > >> > >> BTW. If you are new to Python I?d look into using Python 3.6 instead, both because that has less change to run into problems due to interference between the system install of Python 2.7 and a manual installation, and because the Python community is moving ever faster to Python 3. > >> > >> Ronald > >> > > > > _______________________________________________ > > 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 > > 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 ronaldoussoren at mac.com Sun May 7 04:01:45 2017 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 07 May 2017 10:01:45 +0200 Subject: [Pythonmac-SIG] PyObjC - Apple sample code In-Reply-To: <27ADFE2C-C931-4EBB-BEFD-20E321DEBEEC@me.com> References: <91AD7D8E-3FC2-411D-A632-9E3FD93BB1EF@me.com> <98C40132-7FF6-4C35-BF04-28603AFC3646@me.com> <005E6357-8336-4F6C-803D-52E2E09B00F7@twistedmatrix.com> <27ADFE2C-C931-4EBB-BEFD-20E321DEBEEC@me.com> Message-ID: <1ADB04DC-47B5-4309-BA89-FE944631E2C7@mac.com> > On 2 May 2017, at 13:47, Ben Byram-Wigfield wrote: > > I reinstalled python 2.7.13 from a fresh downloaded .pkg, and used pip to reinstall PyObjC, but I still get the same errors. > Do the Quartz example scripts work on python 3 ? The example work with both python 3 and python 2.7. Ronald > > Ben > >> On 29 Apr 2017, at 05:57, Christopher Barker > wrote: >> >> And you really don't want to use easy_install amymore, either. Try pip. >> >> I see the appeal of an Apple-supplied python, but Apple has never properly supported it ever since OS-X 10.1..... >> >> -CHB >> >> >> >> >> On Fri, Apr 28, 2017 at 5:19 PM Glyph > wrote: >> Relying on the system Python for this sort of stuff has always guaranteed you'd have an out-of-date version of all of your dependencies. >> >> The availability of wheels (thanks again Ronald!!!) for pyobjc means that you don't need the biggest impediment to users installing stuff, which is a C compiler. If you're building stuff for distribution to non-technical folks, build it with your own version of python (3) and ship it with py2app, not by copying scripts around. >> >> If there are things that make this more painful than just copying individual scripts, it's probably best to figure out how to get those addressed with the PyPA community. >> >> -glyph >> >> > On Apr 28, 2017, at 4:20 AM, Ben Byram-Wigfield > wrote: >> > >> > I ran the installer package for the latest python 2.7, and then used easy_install to install PyObjC. >> > I get the same errors on two separate Macs. What should I do to fix the installation? >> > >> > Does Apple not have plans to include (all of) the latest PyObjC? That?s rather sad. The reason I was attracted to creating ObjC python scripts was that they could run on any Mac. >> > >> > Thanks >> > >> > Ben >> > >> > >> >> On 28 Apr 2017, at 08:07, Ronald Oussoren > wrote: >> >> >> >> >> >>> On 27 Apr 2017, at 10:17, Ben Byram-Wigfield > wrote: >> >>> >> >>> I tried the repository browser there, and the version of parse_page_contents.py still doesn?t work for me. I?m using the latest downloaded versions of python 2.7 and PyObjC. I also tried using the default OS X versions. >> >>> The errors are in the attached file. >> >>> >> >> The PyObjC 3.2 error at the top of the file seems to indicate that your Python installation is broken, PyObjC imports the stdlib io module and that causes and error. >> >> >> >> The PyObjC 2.5 error is due to general brokeness of the system installation of PyObjC. PyObjC 2.5 is ancient and not something I support anymore, furthermore (IIRC) Apple doesn?t ship all of PyObjC. The error you?re getting indicates that the framework wrappers are incomplete. >> >> >> >> BTW. If you are new to Python I?d look into using Python 3.6 instead, both because that has less change to run into problems due to interference between the system install of Python 2.7 and a manual installation, and because the Python community is moving ever faster to Python 3. >> >> >> >> Ronald >> >> >> > >> > _______________________________________________ >> > 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 >> >> Python Language Consulting >> - Teaching >> - Scientific Software Development >> - Desktop GUI and Web Development >> - wxPython, numpy, scipy, Cython > > _______________________________________________ > 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 ben.bw at me.com Sun May 7 08:37:03 2017 From: ben.bw at me.com (Ben Byram-Wigfield) Date: Sun, 07 May 2017 13:37:03 +0100 Subject: [Pythonmac-SIG] PyObjC - Apple sample code In-Reply-To: <1ADB04DC-47B5-4309-BA89-FE944631E2C7@mac.com> References: <91AD7D8E-3FC2-411D-A632-9E3FD93BB1EF@me.com> <98C40132-7FF6-4C35-BF04-28603AFC3646@me.com> <005E6357-8336-4F6C-803D-52E2E09B00F7@twistedmatrix.com> <27ADFE2C-C931-4EBB-BEFD-20E321DEBEEC@me.com> <1ADB04DC-47B5-4309-BA89-FE944631E2C7@mac.com> Message-ID: <2F0F7D49-258D-460E-A0B8-3871CBB198AB@me.com> Sorry, this just isn?t working for me. I?ve installed Python 3; I?ve reinstalled PyObjC using pip; and I?m still getting syntax errors when I run the script. line 177, in createMyOperatorTable Quartz.CGPDFOperatorTableSetCallback(myTable, b"Do", myOperator_Do) ValueError: depythonifying 'pointer', got 'bytes' I get different errors, depending on which one of the many versions of the script I download from the PyOBjC Apple open source depository. Thanks Ben > On 7 May 2017, at 09:01, Ronald Oussoren wrote: > >> >> On 2 May 2017, at 13:47, Ben Byram-Wigfield > wrote: >> >> I reinstalled python 2.7.13 from a fresh downloaded .pkg, and used pip to reinstall PyObjC, but I still get the same errors. >> Do the Quartz example scripts work on python 3 ? > > The example work with both python 3 and python 2.7. > > Ronald > >> >> Ben >> >>> On 29 Apr 2017, at 05:57, Christopher Barker > wrote: >>> >>> And you really don't want to use easy_install amymore, either. Try pip. >>> >>> I see the appeal of an Apple-supplied python, but Apple has never properly supported it ever since OS-X 10.1..... >>> >>> -CHB >>> >>> >>> >>> >>> On Fri, Apr 28, 2017 at 5:19 PM Glyph > wrote: >>> Relying on the system Python for this sort of stuff has always guaranteed you'd have an out-of-date version of all of your dependencies. >>> >>> The availability of wheels (thanks again Ronald!!!) for pyobjc means that you don't need the biggest impediment to users installing stuff, which is a C compiler. If you're building stuff for distribution to non-technical folks, build it with your own version of python (3) and ship it with py2app, not by copying scripts around. >>> >>> If there are things that make this more painful than just copying individual scripts, it's probably best to figure out how to get those addressed with the PyPA community. >>> >>> -glyph >>> >>> > On Apr 28, 2017, at 4:20 AM, Ben Byram-Wigfield > wrote: >>> > >>> > I ran the installer package for the latest python 2.7, and then used easy_install to install PyObjC. >>> > I get the same errors on two separate Macs. What should I do to fix the installation? >>> > >>> > Does Apple not have plans to include (all of) the latest PyObjC? That?s rather sad. The reason I was attracted to creating ObjC python scripts was that they could run on any Mac. >>> > >>> > Thanks >>> > >>> > Ben >>> > >>> > >>> >> On 28 Apr 2017, at 08:07, Ronald Oussoren > wrote: >>> >> >>> >> >>> >>> On 27 Apr 2017, at 10:17, Ben Byram-Wigfield > wrote: >>> >>> >>> >>> I tried the repository browser there, and the version of parse_page_contents.py still doesn?t work for me. I?m using the latest downloaded versions of python 2.7 and PyObjC. I also tried using the default OS X versions. >>> >>> The errors are in the attached file. >>> >>> >>> >> The PyObjC 3.2 error at the top of the file seems to indicate that your Python installation is broken, PyObjC imports the stdlib io module and that causes and error. >>> >> >>> >> The PyObjC 2.5 error is due to general brokeness of the system installation of PyObjC. PyObjC 2.5 is ancient and not something I support anymore, furthermore (IIRC) Apple doesn?t ship all of PyObjC. The error you?re getting indicates that the framework wrappers are incomplete. >>> >> >>> >> BTW. If you are new to Python I?d look into using Python 3.6 instead, both because that has less change to run into problems due to interference between the system install of Python 2.7 and a manual installation, and because the Python community is moving ever faster to Python 3. >>> >> >>> >> Ronald >>> >> >>> > >>> > _______________________________________________ >>> > 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 >>> >>> Python Language Consulting >>> - Teaching >>> - Scientific Software Development >>> - Desktop GUI and Web Development >>> - wxPython, numpy, scipy, Cython >> >> _______________________________________________ >> 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: