From a.h.jaffe at gmail.com Sun Sep 11 06:12:18 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Sun, 11 Sep 2016 11:12:18 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: Message-ID: Dear Ronald, Thanks, as usual, for all this. I have upgraded to the GM version of 10.12 on the beta track. I use the python.org framework builds of python. When I do "pip list --outdated", I get a long list: altgraph (0.10.2) - Latest: 0.12 [sdist] macholib (1.5.1) - Latest: 1.7 [sdist] modulegraph (0.10.4) - Latest: 0.12.1 [sdist] py2app (0.7.3) - Latest: 0.10 [sdist] pyobjc-core (2.5.1) - Latest: 3.1.1 [sdist] pyobjc-framework-Accounts (2.5.1) - Latest: 3.1.1 [sdist] pyOpenSSL (0.13.1) - Latest: 16.1.0 [wheel] xattr (0.6.4) - Latest: 0.8.0 [sdist] If I do the usual "pip --upgrade" for these, it fails, seemingly because of permissions (Apologies, but I don't have access to the messages anymore): it is clearly trying to delete these versions which seem to live in /System/Library/Frameworks/Python.framework/Versions/2.7/. This fails, of course, due to permissions (and system integrity protection). You can, in fact, do the upgrade with the "--ignore-installed" flag in pip (although there's still a problem with pyobjc-framework-Message). So: are these errors expected? Is it something in my particular setup? Or the beta program? Is "--ignore-installed" the correct solution? Thanks, Andrew p.s. none of these issues arise with Python3/pip3, of course. On 22/07/2016 14:46, Ronald Oussoren wrote: > Hi, > > I?m slowly working my way through the SDK headers for macOS 10.12 during idle time at EuroPython2016, from the frameworks with small diffs to those with larger diffs. > > There are at the moment about 26 frameworks I haven?t looked at at all, and another 10 where I know I have to do some more work. The rest should have up to date metadata on my machine, but haven?t been tested on macOS 10.12 yet (and that won?t change until I get around to actually installing a VM running 10.12). > > All of this was done using the headers in the Xcode 8 beta 2, I haven?t looked at the incremental changes to the SDK in beta 3 yet (and likely won?t until I have made a pass through all frameworks). That said, the diffs from beta 2 to later beta?s and the final release should be fairly small (he wrote hopefully). > > What needs to be done to get proper support for 10.12: > > * Finish updating the metadata. I suspect that this is a couple of days work, I have worked may way through the diffs of a fairly large number of frameworks, but haven?t looked at the more complicated ones yet (such as Foundation and AppKit). Also, a fairly large subset of the frameworks I have looked at didn?t have any significant updates compared to 10.11 (but some of them still had large textual diffs due to restructuring of header files). > > * Install a 10.12 VM and run tests there. This will likely result in more work, there?s already a pull request about NSSecureCoder warnings on 10.12 that needs looking into and there?s bound to be more issues. > > * Do the build and test dance on older OSX releases. > The annoying bit for that: there?s a know issue with building on OSX 10.7, see issue #100. I haven?t been able to look into that yet > because I don?t have an VM with 10.7 on my laptop and haven?t been able to install 10.7 there yet. I probably have such a VM on > an external disk somewhere, but I?m not sure about that. > > When all that is done I can do a release that includes 10.12 support, with some luck around the time of the 10.12 release itself. I?ll definitely push the metadata updates to bitbucket once I?ve finished looking through the 10.12 SDK diffs. > > In the longer run I want to provide wheels for PyObjC, but that requires more work. In particular, I only want to do that after automating more of the release work because I?ve noticed that I?m already postponing doing new releases due to the amount of work and don?t want to make things worse in that regard. > > BTW. I?ll likely won?t work on metadata updates during the EP2016 sprints, my current plan is to keep the tradition of working on PEP 447 alive and try to actually get it accepted this year. > > Ronald > > PS. ?A couple of days work? probably means that it will take me several calendar weeks to actually finish the work because I have limited time to work on this and don?t want to spent all that time on this rather tedious work. > > [#100]: https://bitbucket.org/ronaldoussoren/pyobjc/issues/100/cannot-find-interface-declaration-for > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Pyobjc-dev mailing list > Pyobjc-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > From a.h.jaffe at gmail.com Tue Sep 13 14:50:53 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 13 Sep 2016 19:50:53 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: Message-ID: Dear Chris and Glyph, > > On Sunday, September 11, 2016, Andrew Jaffe wrote: > Dear Ronald, > > Thanks, as usual, for all this. > > I have upgraded to the GM version of 10.12 on the beta track. I use the python.org framework builds of python. > > When I do "pip list --outdated", I get a long list: ?. > If I do the usual "pip --upgrade" for these, it fails, seemingly because of permissions (Apologies, but I don't have access to the messages anymore): it is clearly trying to delete these versions which seem to live in /System/Library/Frameworks/Python.framework/Versions/2.7/. This fails, of course, due to permissions (and system integrity protection). > > You can, in fact, do the upgrade with the "--ignore-installed" flag in pip (although there's still a problem with pyobjc-framework-Message). > > So: are these errors expected? Is it something in my particular setup? Or the beta program? Is "--ignore-installed" the correct solution? > > Thanks, > > Andrew > >> On 13 Sep 2016, at 16:13, Christopher Barker wrote: >> >> If you are dealing with stuff in /System, then you are dealing with the Ape installed Python, not the Python.org build. >> >> It's easy for "pip" and python to get out of sync. >> >> Try "which pip" to see which pip you are running. >> >> This is why I recommend encoding pip via: >> >> python -m pip [args] [I tried to comment via the gmane newsgroup version of the lists and my messages never appeared so I hope this works?] Just to be clear, I am indeed using the framework pip, which is part of why this is so confusing. In the past, as far as I know, it?s never tried to have anything to do with /System. Again, I don?t know if it?s something about macOS 10.12 Sierra, or my particular setup that is the problem. Also, to be clear, there are no PYTHON* or other environment variables that would affect the python path. Here is a failing session? (Aside: I understand that "pyobjc-framework-Message? is actually a bad example: it is the only package that even ?-ignore-installed actually fails on, because it has the "--single-version-externally-managed? problem which is a different kettle of fish. But I think the above error message is the same as the one that I would get for any of the other packages in question. Note that pip2 install works fine for packages other than those in my original list.) $ command which pip2 /Library/Frameworks/Python.framework/Versions/2.7/bin/pip2 $ pip2 install --upgrade pyobjc-framework-Message Collecting pyobjc-framework-Message Using cached pyobjc-framework-Message-3.1.1.tar.gz Requirement already up-to-date: pyobjc-core>=3.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pyobjc-framework-Message) Requirement already up-to-date: pyobjc-framework-Cocoa>=3.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pyobjc-framework-Message) Installing collected packages: pyobjc-framework-Message Found existing installation: pyobjc-framework-Message 2.5.1 Uninstalling pyobjc-framework-Message-2.5.1: Exception: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run prefix=options.prefix_path, File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install requirement.uninstall(auto_confirm=True) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames shutil.move(old, new) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move copytree(src, real_dst, symlinks=True) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree raise Error, errors Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message'?)] From jack.jansen at cwi.nl Tue Sep 13 15:05:33 2016 From: jack.jansen at cwi.nl (Jack Jansen) Date: Tue, 13 Sep 2016 21:05:33 +0200 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: Message-ID: I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. Could it be that you?ve installed pyobjc a couple of OSX releases ago? And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. Jack > On 13-Sep-2016, at 20:50 , Andrew Jaffe wrote: > > Dear Chris and Glyph, >> >> On Sunday, September 11, 2016, Andrew Jaffe wrote: >> Dear Ronald, >> >> Thanks, as usual, for all this. >> >> I have upgraded to the GM version of 10.12 on the beta track. I use the python.org framework builds of python. >> >> When I do "pip list --outdated", I get a long list: > > ?. > >> If I do the usual "pip --upgrade" for these, it fails, seemingly because of permissions (Apologies, but I don't have access to the messages anymore): it is clearly trying to delete these versions which seem to live in /System/Library/Frameworks/Python.framework/Versions/2.7/. This fails, of course, due to permissions (and system integrity protection). >> >> You can, in fact, do the upgrade with the "--ignore-installed" flag in pip (although there's still a problem with pyobjc-framework-Message). >> >> So: are these errors expected? Is it something in my particular setup? Or the beta program? Is "--ignore-installed" the correct solution? >> >> Thanks, >> >> Andrew >> >>> On 13 Sep 2016, at 16:13, Christopher Barker wrote: >>> >>> If you are dealing with stuff in /System, then you are dealing with the Ape installed Python, not the Python.org build. >>> >>> It's easy for "pip" and python to get out of sync. >>> >>> Try "which pip" to see which pip you are running. >>> >>> This is why I recommend encoding pip via: >>> >>> python -m pip [args] > > [I tried to comment via the gmane newsgroup version of the lists and my messages never appeared so I hope this works?] > > Just to be clear, I am indeed using the framework pip, which is part of why this is so confusing. In the past, as far as I know, it?s never tried to have anything to do with /System. Again, I don?t know if it?s something about macOS 10.12 Sierra, or my particular setup that is the problem. Also, to be clear, there are no PYTHON* or other environment variables that would affect the python path. Here is a failing session? > > (Aside: I understand that "pyobjc-framework-Message? is actually a bad example: it is the only package that even ?-ignore-installed actually fails on, because it has the "--single-version-externally-managed? problem which is a different kettle of fish. But I think the above error message is the same as the one that I would get for any of the other packages in question. Note that pip2 install works fine for packages other than those in my original list.) > > $ command which pip2 > /Library/Frameworks/Python.framework/Versions/2.7/bin/pip2 > > $ pip2 install --upgrade pyobjc-framework-Message > Collecting pyobjc-framework-Message > Using cached pyobjc-framework-Message-3.1.1.tar.gz > Requirement already up-to-date: pyobjc-core>=3.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pyobjc-framework-Message) > Requirement already up-to-date: pyobjc-framework-Cocoa>=3.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pyobjc-framework-Message) > Installing collected packages: pyobjc-framework-Message > Found existing installation: pyobjc-framework-Message 2.5.1 > Uninstalling pyobjc-framework-Message-2.5.1: > Exception: > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main > status = self.run(options, args) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run > prefix=options.prefix_path, > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install > requirement.uninstall(auto_confirm=True) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall > paths_to_remove.remove(auto_confirm) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove > renames(path, new_path) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames > shutil.move(old, new) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move > copytree(src, real_dst, symlinks=True) > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree > raise Error, errors > Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/_metadata.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message', '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message', "[Errno 1] Operation not permitted: '/var/folders/bk/zdhpxqj14y5fzcvlpybb4b640000gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message'?)] > > > _______________________________________________ > 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 From jack.jansen at cwi.nl Tue Sep 13 17:26:23 2016 From: jack.jansen at cwi.nl (Jack Jansen) Date: Tue, 13 Sep 2016 23:26:23 +0200 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> Message-ID: <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> You?re absolutely right (both on SIP and on /Library/Frameworks/Python.framework probably being a python.org install), sorry for the confusion. This seems to be due to the way Apple has done the ?Extras? directory, and adding things there to sys.path. See for example https://github.com/pypa/pip/issues/2468 If you can get rid of /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python in sys.path you should be all set. > On 13-Sep-2016, at 22:59 , Glyph Lefkowitz wrote: > > >> On Sep 13, 2016, at 12:05 PM, Jack Jansen wrote: >> >> I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. >> >> Could it be that you?ve installed pyobjc a couple of OSX releases ago? > > This is always worth checking ;). Particularly if it was a few Setuptools releases ago. Also worth checking: ~/Library/Python. > >> And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? > > SIP locks down /System, not /Library. > >> A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. > > This should be an _absolute_ last resort, though. You should be able to clean out /Library just fine. If you have a /Library/Frameworks/Python.framework, that's probably Python.org python, not system python. > > -glyph -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From a.h.jaffe at gmail.com Tue Sep 13 17:37:41 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 13 Sep 2016 22:37:41 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> Message-ID: <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> Hi, > On 13 Sep 2016, at 22:26, Jack Jansen wrote: > > You?re absolutely right (both on SIP and on /Library/Frameworks/Python.framework probably being a python.org install), sorry for the confusion. > > This seems to be due to the way Apple has done the ?Extras? directory, and adding things there to sys.path. > > See for example https://github.com/pypa/pip/issues/2468 > > If you can get rid of /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python in sys.path you should be all set. Thanks, guys. Indeed, these /System/Library dirs are in sys.path: In [1]: import sys In [2]: print [p for p in sys.path if 'System' in p] ['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC?] But I?m still confused: why is this problem only showing up now? Is the same setup that everyone has? Or is it just me for some reason? How and where would sys.path be set to this, and how and where should I change it? (Without disabling SIP, please!) Andrew >> On 13-Sep-2016, at 22:59 , Glyph Lefkowitz wrote: >> >> >>> On Sep 13, 2016, at 12:05 PM, Jack Jansen wrote: >>> >>> I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. >>> >>> Could it be that you?ve installed pyobjc a couple of OSX releases ago? >> >> This is always worth checking ;). Particularly if it was a few Setuptools releases ago. Also worth checking: ~/Library/Python. >> >>> And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? >> >> SIP locks down /System, not /Library. >> >>> A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. >> >> This should be an _absolute_ last resort, though. You should be able to clean out /Library just fine. If you have a /Library/Frameworks/Python.framework, that's probably Python.org python, not system python. >> >> -glyph > > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > From jack.jansen at cwi.nl Tue Sep 13 17:56:00 2016 From: jack.jansen at cwi.nl (Jack Jansen) Date: Tue, 13 Sep 2016 23:56:00 +0200 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> Message-ID: It?s hardcoded in the Python executable, I?m afraid:-( Just tried ?python -s -S -v?, and the Extras/lib/python is still in sys.path. That wasn?t a very smart move by the Apple engineers, I guess?. What you could do (but this is getting rather hacky) is create a /Library/Python/2.7/site-packages/removeSystemExtras.pth where you import sys and manually remove the Extras entries. Be careful, putting code (as opposed to pathnames) into a .pth file requires the line to start with ?import ?. Jack > On 13-Sep-2016, at 23:37 , Andrew Jaffe wrote: > > Hi, > > >> On 13 Sep 2016, at 22:26, Jack Jansen wrote: >> >> You?re absolutely right (both on SIP and on /Library/Frameworks/Python.framework probably being a python.org install), sorry for the confusion. >> >> This seems to be due to the way Apple has done the ?Extras? directory, and adding things there to sys.path. >> >> See for example https://github.com/pypa/pip/issues/2468 >> >> If you can get rid of /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python in sys.path you should be all set. > > Thanks, guys. > > Indeed, these /System/Library dirs are in sys.path: > > In [1]: import sys > In [2]: print [p for p in sys.path if 'System' in p] > ['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC?] > > But I?m still confused: why is this problem only showing up now? Is the same setup that everyone has? Or is it just me for some reason? How and where would sys.path be set to this, and how and where should I change it? (Without disabling SIP, please!) > > Andrew > > > > > > > >>> On 13-Sep-2016, at 22:59 , Glyph Lefkowitz wrote: >>> >>> >>>> On Sep 13, 2016, at 12:05 PM, Jack Jansen wrote: >>>> >>>> I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. >>>> >>>> Could it be that you?ve installed pyobjc a couple of OSX releases ago? >>> >>> This is always worth checking ;). Particularly if it was a few Setuptools releases ago. Also worth checking: ~/Library/Python. >>> >>>> And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? >>> >>> SIP locks down /System, not /Library. >>> >>>> A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. >>> >>> This should be an _absolute_ last resort, though. You should be able to clean out /Library just fine. If you have a /Library/Frameworks/Python.framework, that's probably Python.org python, not system python. >>> >>> -glyph >> >> -- >> Jack Jansen, , http://www.cwi.nl/~jack >> If I can't dance I don't want to be part of your revolution -- Emma Goldman >> >> >> > -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From a.h.jaffe at gmail.com Tue Sep 13 18:05:49 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 13 Sep 2016 23:05:49 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> Message-ID: OK, I?m still being dense: > On 13 Sep 2016, at 22:56, Jack Jansen wrote: > > It?s hardcoded in the Python executable, I?m afraid:-( > > Just tried ?python -s -S -v?, and the Extras/lib/python is still in sys.path. > > That wasn?t a very smart move by the Apple engineers, I guess?. But this is the framework (non-apple!) build!? And, again: why isn?t everyone seeing this all the time? (And why didn?t I see it before?) > What you could do (but this is getting rather hacky) is create a /Library/Python/2.7/site-packages/removeSystemExtras.pth where you import sys and manually remove the Extras entries. Be careful, putting code (as opposed to pathnames) into a .pth file requires the line to start with ?import ?. > > Jack > >> On 13-Sep-2016, at 23:37 , Andrew Jaffe wrote: >> >> Hi, >> >> >>> On 13 Sep 2016, at 22:26, Jack Jansen wrote: >>> >>> You?re absolutely right (both on SIP and on /Library/Frameworks/Python.framework probably being a python.org install), sorry for the confusion. >>> >>> This seems to be due to the way Apple has done the ?Extras? directory, and adding things there to sys.path. >>> >>> See for example https://github.com/pypa/pip/issues/2468 >>> >>> If you can get rid of /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python in sys.path you should be all set. >> >> Thanks, guys. >> >> Indeed, these /System/Library dirs are in sys.path: >> >> In [1]: import sys >> In [2]: print [p for p in sys.path if 'System' in p] >> ['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC?] >> >> But I?m still confused: why is this problem only showing up now? Is the same setup that everyone has? Or is it just me for some reason? How and where would sys.path be set to this, and how and where should I change it? (Without disabling SIP, please!) >> >> Andrew >> >> >> >> >> >> >> >>>> On 13-Sep-2016, at 22:59 , Glyph Lefkowitz wrote: >>>> >>>> >>>>> On Sep 13, 2016, at 12:05 PM, Jack Jansen wrote: >>>>> >>>>> I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. >>>>> >>>>> Could it be that you?ve installed pyobjc a couple of OSX releases ago? >>>> >>>> This is always worth checking ;). Particularly if it was a few Setuptools releases ago. Also worth checking: ~/Library/Python. >>>> >>>>> And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? >>>> >>>> SIP locks down /System, not /Library. >>>> >>>>> A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. >>>> >>>> This should be an _absolute_ last resort, though. You should be able to clean out /Library just fine. If you have a /Library/Frameworks/Python.framework, that's probably Python.org python, not system python. >>>> >>>> -glyph >>> >>> -- >>> Jack Jansen, , http://www.cwi.nl/~jack >>> If I can't dance I don't want to be part of your revolution -- Emma Goldman >>> >>> >>> >> > > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma Goldman > > > From a.h.jaffe at gmail.com Tue Sep 13 18:35:58 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 13 Sep 2016 23:35:58 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> Message-ID: <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> Hi, > On 13 Sep 2016, at 23:28, Glyph Lefkowitz wrote: > > >> On Sep 13, 2016, at 3:05 PM, Andrew Jaffe wrote: >> >> But this is the framework (non-apple!) build!? > > "framework build" refers to the way that Python is built. Apple's python, Python.org's python, and Homebrew's python are all framework builds. So, to be clear: this is python.org python? > Doh! Yes, sorry, I think I said this way back in the thread: python.org 2.7.12 (problem doesn?t arise with 3.5.2, also installed). But see this... >> And, again: why isn?t everyone seeing this all the time? (And why didn?t I see it before?) > > There's probably a .pth file somewhere that is stuffing Extras on your sys.path. easy_install (especially older versions) is notorious for creating such things in ways that are hard to inspect for. My usual recommendation at this point is to blow away _everything_ in /Library/Python, ~/Library/Python, ~/.local/lib/python*, and /Library/Frameworks/Python.framework and then reinstall from scratch. (Thanks to SIP you don't need to blow away anything in /System anymore; hooray!) Aha! $ ls -lt /Library/Python/2.7/site-packages/ total 0 -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README $ more /Library/Python/2.7/site-packages/Extras.pth /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC Now I wonder how those got there?! A > > -glyph From nad at python.org Sat Sep 17 12:27:16 2016 From: nad at python.org (Ned Deily) Date: Sat, 17 Sep 2016 12:27:16 -0400 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> Message-ID: On 2016-09-13 19:33, Glyph Lefkowitz wrote: >> On Sep 13, 2016, at 3:35 PM, Andrew Jaffe > > wrote: >> >> Aha! >> >> $ ls -lt /Library/Python/2.7/site-packages/ >> total 0 >> -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* >> -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README >> $ more /Library/Python/2.7/site-packages/Extras.pth >> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python >> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC >> >> Now I wonder how those got there?! >> > > Hah! Thanks for sharing. Very satisfying to actually make a *correct* > prediction about setuptools' behavior :) This seems to be Apple's doing. AFAICT, 10.12 is shipping with this Extras.pth file in /Library/Python/2.7; it's something new. And, unfortunately, due to https://bugs.python.org/issue4865, the site-packages directory for the system Python 2.7 is included in sys.path along with the non-system framework Python site-packages. From a.h.jaffe at gmail.com Tue Sep 20 13:29:20 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 20 Sep 2016 18:29:20 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> Message-ID: <077c58c7-7c19-d21f-7c4f-254011d2868e@gmail.com> On 17/09/2016 18:59, Glyph Lefkowitz wrote: > >> On Sep 17, 2016, at 9:27 AM, Ned Deily wrote: >> >> On 2016-09-13 19:33, Glyph Lefkowitz wrote: >>>> On Sep 13, 2016, at 3:35 PM, Andrew Jaffe >>> > wrote: >>>> >>>> Aha! >>>> >>>> $ ls -lt /Library/Python/2.7/site-packages/ >>>> total 0 >>>> -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* >>>> -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README >>>> $ more /Library/Python/2.7/site-packages/Extras.pth >>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python >>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC >>>> >>>> Now I wonder how those got there?! >>>> >>> >>> Hah! Thanks for sharing. Very satisfying to actually make a *correct* >>> prediction about setuptools' behavior :) >> >> This seems to be Apple's doing. AFAICT, 10.12 is shipping with this >> Extras.pth file in /Library/Python/2.7; it's something new. And, >> unfortunately, due to https://bugs.python.org/issue4865, the >> site-packages directory for the system Python 2.7 is included in >> sys.path along with the non-system framework Python site-packages. > > Hrm. I guess everyone I knew on the beta was using homebrew python :(. > > I'm surprised that Apple is putting stuff in /Library. I don't have a Sierra box handy - /Library isn't SIP-protected now, is it? Nope, that's not a problem. > > This seems wrong; someone should file a radar (and probably share on http://www.openradar.me for further discussion). In the meantime, what's the recommended workaround? A From a.h.jaffe at gmail.com Wed Sep 21 04:52:22 2016 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Wed, 21 Sep 2016 09:52:22 +0100 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <955E6FFA-9BB7-4162-9516-97A222A26A3A@twistedmatrix.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> <077c58c7-7c19-d21f-7c4f-254011d2868e@gmail.com> <955E6FFA-9BB7-4162-9516-97A222A26A3A@twistedmatrix.com> Message-ID: <7ac897b7-51ab-ad5f-3f63-369ec70b5e67@gmail.com> On 20/09/2016 20:54, Glyph Lefkowitz wrote: >> On Sep 20, 2016, at 10:29 AM, Andrew Jaffe wrote: >> >> On 17/09/2016 18:59, Glyph Lefkowitz wrote: >>> >>>> On Sep 17, 2016, at 9:27 AM, Ned Deily wrote: >>>> >>>> On 2016-09-13 19:33, Glyph Lefkowitz wrote: >>>>>> On Sep 13, 2016, at 3:35 PM, Andrew Jaffe wrote: >>>>>> >>>>>> Aha! >>>>>> >>>>>> $ ls -lt /Library/Python/2.7/site-packages/ >>>>>> total 0 >>>>>> -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* >>>>>> -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README >>>>>> $ more /Library/Python/2.7/site-packages/Extras.pth >>>>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python >>>>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC >>>>>> >>>>> Hah! Thanks for sharing. Very satisfying to actually make a *correct* >>>>> prediction about setuptools' behavior :) >>>> >>>> This seems to be Apple's doing. AFAICT, 10.12 is shipping with this >>>> Extras.pth file in /Library/Python/2.7; it's something new. And, >>>> unfortunately, due to https://bugs.python.org/issue4865, the >>>> site-packages directory for the system Python 2.7 is included in >>>> sys.path along with the non-system framework Python site-packages. >>> >>> This seems wrong; someone should file a radar (and probably share >>> on http://www.openradar.me for further >>> discussion). >> >> In the meantime, what's the recommended workaround? > > Looking back over the thread, my first reply was: "Make a virtualenv and > install pyobjc there", but I didn't see a direct response to that. That > would still be my first choice for a workaround. Is there some reason > that doesn't work for you? That would work, and in fact I don't really need PyObjC (sorry, Ronald!) but I've got my whole setup working with the "global" python.org framework build, so I am used to that... and the Sierra status quo does seem ugly (and quite possibly is a bug!). Andrew From barry at barrys-emacs.org Sun Sep 25 05:38:41 2016 From: barry at barrys-emacs.org (Barry Scott) Date: Sun, 25 Sep 2016 10:38:41 +0100 Subject: [Pythonmac-SIG] py2app questions Message-ID: <85217309-3C49-4FDA-9471-B65861FB0A5A@barrys-emacs.org> I?m a happy user of py2app and thanks to all the work that has gone into py2app. I?m using py2app to package a couple of apps that use PyQt and pytz. I found that the resulting app has the .dylib files in the python35.zip. Is that correct? I had assumed that .dylib files need to be in the .app as files, is there a trick to run them out of the .zip file? I have been copying in the PyQt .dylib, plugins etc into the .app with a script that adds these in Contents/Frameworks etc after fixing up the RPATHs. For pytz to work in a py2app .app pkg_resources needs to work and it does not. Is this a known issue? I worked around it with a stub pkg_resources package that reached into the python35.zip and pulled out the zoneinfo files. It seems that py2app will package up all the files in a package, not just the .py files. Is that the algorithm that is used? Barry From glyph at twistedmatrix.com Tue Sep 13 16:59:14 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Tue, 13 Sep 2016 20:59:14 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: Message-ID: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> > On Sep 13, 2016, at 12:05 PM, Jack Jansen wrote: > > I think /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is a very old location for storing Python packages. Recently things have been installed in /Library/Python/2.7/site-packages. > > Could it be that you?ve installed pyobjc a couple of OSX releases ago? This is always worth checking ;). Particularly if it was a few Setuptools releases ago. Also worth checking: ~/Library/Python. > And could it be that the OSX upgrade that introduced SIP somehow didn?t clean out user-installed things from /Library/Frameworks before turning off write permission? SIP locks down /System, not /Library. > A possible workaround is to turn off SIP (or boot from the recovery partition), record what is in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and then clean it out. Then after a reboot re-install the packages you?re still using. This should be an _absolute_ last resort, though. You should be able to clean out /Library just fine. If you have a /Library/Frameworks/Python.framework, that's probably Python.org python, not system python. -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: From glyph at twistedmatrix.com Tue Sep 13 18:28:19 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Tue, 13 Sep 2016 22:28:19 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> Message-ID: <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> > On Sep 13, 2016, at 3:05 PM, Andrew Jaffe wrote: > > But this is the framework (non-apple!) build!? "framework build" refers to the way that Python is built. Apple's python, Python.org's python, and Homebrew's python are all framework builds. So, to be clear: this is python.org python? > And, again: why isn?t everyone seeing this all the time? (And why didn?t I see it before?) There's probably a .pth file somewhere that is stuffing Extras on your sys.path. easy_install (especially older versions) is notorious for creating such things in ways that are hard to inspect for. My usual recommendation at this point is to blow away _everything_ in /Library/Python, ~/Library/Python, ~/.local/lib/python*, and /Library/Frameworks/Python.framework and then reinstall from scratch. (Thanks to SIP you don't need to blow away anything in /System anymore; hooray!) -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: From glyph at twistedmatrix.com Tue Sep 13 19:33:45 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Tue, 13 Sep 2016 23:33:45 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> Message-ID: <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> > On Sep 13, 2016, at 3:35 PM, Andrew Jaffe wrote: > > Aha! > > $ ls -lt /Library/Python/2.7/site-packages/ > total 0 > -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* > -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README > $ more /Library/Python/2.7/site-packages/Extras.pth > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC > > Now I wonder how those got there?! > Hah! Thanks for sharing. Very satisfying to actually make a *correct* prediction about setuptools' behavior :) -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: From glyph at twistedmatrix.com Sat Sep 17 13:59:04 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Sat, 17 Sep 2016 17:59:04 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> Message-ID: <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> > On Sep 17, 2016, at 9:27 AM, Ned Deily wrote: > > On 2016-09-13 19:33, Glyph Lefkowitz wrote: >>> On Sep 13, 2016, at 3:35 PM, Andrew Jaffe >> > wrote: >>> >>> Aha! >>> >>> $ ls -lt /Library/Python/2.7/site-packages/ >>> total 0 >>> -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* >>> -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README >>> $ more /Library/Python/2.7/site-packages/Extras.pth >>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python >>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC >>> >>> Now I wonder how those got there?! >>> >> >> Hah! Thanks for sharing. Very satisfying to actually make a *correct* >> prediction about setuptools' behavior :) > > This seems to be Apple's doing. AFAICT, 10.12 is shipping with this > Extras.pth file in /Library/Python/2.7; it's something new. And, > unfortunately, due to https://bugs.python.org/issue4865, the > site-packages directory for the system Python 2.7 is included in > sys.path along with the non-system framework Python site-packages. Hrm. I guess everyone I knew on the beta was using homebrew python :(. I'm surprised that Apple is putting stuff in /Library. I don't have a Sierra box handy - /Library isn't SIP-protected now, is it? This seems wrong; someone should file a radar (and probably share on http://www.openradar.me for further discussion). -glyph From glyph at twistedmatrix.com Tue Sep 20 15:54:28 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Tue, 20 Sep 2016 19:54:28 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <077c58c7-7c19-d21f-7c4f-254011d2868e@gmail.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> <077c58c7-7c19-d21f-7c4f-254011d2868e@gmail.com> Message-ID: <955E6FFA-9BB7-4162-9516-97A222A26A3A@twistedmatrix.com> > On Sep 20, 2016, at 10:29 AM, Andrew Jaffe wrote: > > On 17/09/2016 18:59, Glyph Lefkowitz wrote: >> >>> On Sep 17, 2016, at 9:27 AM, Ned Deily wrote: >>> >>> On 2016-09-13 19:33, Glyph Lefkowitz wrote: >>>>> On Sep 13, 2016, at 3:35 PM, Andrew Jaffe >>>> > wrote: >>>>> >>>>> Aha! >>>>> >>>>> $ ls -lt /Library/Python/2.7/site-packages/ >>>>> total 0 >>>>> -rwxr-xr-x 1 root wheel 157 31 Jul 02:36 Extras.pth* >>>>> -rw-r--r-- 1 root wheel 119 31 Jul 02:36 README >>>>> $ more /Library/Python/2.7/site-packages/Extras.pth >>>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python >>>>> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC >>>>> >>>>> Now I wonder how those got there?! >>>>> >>>> >>>> Hah! Thanks for sharing. Very satisfying to actually make a *correct* >>>> prediction about setuptools' behavior :) >>> >>> This seems to be Apple's doing. AFAICT, 10.12 is shipping with this >>> Extras.pth file in /Library/Python/2.7; it's something new. And, >>> unfortunately, due to https://bugs.python.org/issue4865, the >>> site-packages directory for the system Python 2.7 is included in >>> sys.path along with the non-system framework Python site-packages. >> >> Hrm. I guess everyone I knew on the beta was using homebrew python :(. >> >> I'm surprised that Apple is putting stuff in /Library. I don't have a Sierra box handy - /Library isn't SIP-protected now, is it? > > Nope, that's not a problem. >> >> This seems wrong; someone should file a radar (and probably share on http://www.openradar.me for further discussion). > > In the meantime, what's the recommended workaround? Looking back over the thread, my first reply was: "Make a virtualenv and install pyobjc there", but I didn't see a direct response to that. That would still be my first choice for a workaround. Is there some reason that doesn't work for you? -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: From glyph at twistedmatrix.com Wed Sep 21 05:48:27 2016 From: glyph at twistedmatrix.com (Glyph Lefkowitz) Date: Wed, 21 Sep 2016 09:48:27 -0000 Subject: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra) In-Reply-To: <7ac897b7-51ab-ad5f-3f63-369ec70b5e67@gmail.com> References: <06E9F64E-FBA4-4909-B1F0-EC58A4A73E7A@twistedmatrix.com> <74585C70-1FC2-4B9C-8A50-DFD12D4275F0@cwi.nl> <3C7A8CDB-388E-4938-A0A6-A6B8BAB6C4AF@gmail.com> <9B083D20-E19E-486F-A6E8-AD1167CF8E4B@twistedmatrix.com> <50A5DEF7-0281-4849-B0DA-068357F1DA9D@gmail.com> <162AD212-E975-470F-879C-9BC0E2743F86@twistedmatrix.com> <969CB433-74EF-4417-93F3-46470E4E21A2@twistedmatrix.com> <077c58c7-7c19-d21f-7c4f-254011d2868e@gmail.com> <955E6FFA-9BB7-4162-9516-97A222A26A3A@twistedmatrix.com> <7ac897b7-51ab-ad5f-3f63-369ec70b5e67@gmail.com> Message-ID: > On Sep 21, 2016, at 01:52, Andrew Jaffe wrote: > > That would work, and in fact I don't really need PyObjC (sorry, Ronald!) but I've got my whole setup working with the "global" python.org framework build, so I am used to that... and the Sierra status quo does seem ugly (and quite possibly is a bug!). Well, Apple ships certain libraries, and they want them to be on your path. The nice thing about virtualenv is that, along with pip wheel caching, re-creating them is really fast, so you don't have to just do one setup; you just make a requirements.txt for each separate environment you want, and regularly re-create it, so you know that if you give directions to anyone else, your setup will work for them as well. One bad habit we get into is getting a full-on environment set up on our own workstation, and then not knowing exactly what we installed, and therefore what we need in order for someone else to build and work on our software. Virtualenv helps reduce that problem a bit. -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: