Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Andrew Jaffe
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

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Andrew Jaffe
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
> 
> 
> 

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Jack Jansen
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



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Andrew Jaffe
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
> 
> 
> 

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Jack Jansen
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



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Jack Jansen
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
>

Re: [Pythonmac-SIG] PyObjC and macOS 10.12 (Sierra)

2016-09-13 Thread Andrew Jaffe
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/zdhpxqj14y5fzcvlpybb4b64gn/T/pip-Gd3OiE-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Message/__init__.py',
 "[Errno 1] Operation not permitted: