Fixing Python install on the Mac after running 'CleanMyMac' (fwd)

kacyjones at lclark.edu kacyjones at lclark.edu
Sun Sep 20 23:00:11 EDT 2015


On Friday, May 29, 2015 at 12:56:49 PM UTC-7, Laura Creighton wrote:
> Good news, we are getting closer to understanding what to do.
> This in from Ned.  I will continue after the message:
> 
> ------- Forwarded Message
> 
> Return-Path: <python-list-bounces+lac=openend.se at python.org>
> From: Ned Deily <nad at acm.org>
> Subject: Re: Fixing Python install on the Mac after running 'CleanMyMac'
> Date: Fri, 29 May 2015 10:28:19 -0700
> Lines: 63
> 
> > Might that appear to work at first, but leave some subtle issues which are
> > not at first apparent? I don't know how intertwined Apple's Python instance
> > is in the day-to-day operation of the operating system (it certainly seems
> > to be on some Linux distros), but it's possible that some Apple-specific
> > package isn't available at part of the stock Python 2.7 distribution.
> 
> Installing a python.org Python (/usr/local/bin/python*) is independent 
> of and does not interfere with use of the Apple-supplied system Pythons 
> (/usr/bin/python*).  Apple does ship various third-party Python packages 
> ("distributions") with its system Python, like numpy, but they tend to 
> be old and outdated versions and there are a few Apple-only packages.  
> But, should that issue arise, that can be resolved by choosing the right 
> path (/usr/local/bin vs /usr/bin) or removing /usr/local/bin from $PATH.
> 
> The thing is the original message in this thread had this:
> > They are getting:
> >      Utility has encountered a fatal error, and will now terminate.  A
> >      Python runtime could not be located. You may need to install a
> >      framework build of Python or edit the PyRuntimeLocations array in this
> >      applications info.plist file.  Then there are two oblong circles. One
> >      says Open Console. The other says Terminate.
> 
> But ... I just did what I should have done earlier: googled for that 
> message.  And I find that the message is coming from a py2app-built 
> application (and it seems I answered the question 3 years ago!):
> 
> http://stackoverflow.com/questions/10184974/py2app-is-not-copying-the-pyt
> hon-framework-to-the-new-app-while-using-virutalenv
> 
> The py2app glue code could be looking for Pythons in various spots 
> including the system Python.  So, let's make sure the system Python is 
> still working.  On the most up-to-date 10.7 Lion system (10.7.5), typing 
> the following two commands should give results the same as those shown 
> (->):
> 
> /usr/bin/python2.7 -c 'import sys;print(sys.version)'
> - -> 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
> - -> [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]
> 
> /usr/bin/python2.7 -c 'import numpy;print(numpy.__file__)'
> - -> 
> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/pytho
> n/numpy/__init__.py
> 
> If not, then it really may be necessary to restore system files which, 
> as I noted before, is most safely and accurately done by following 
> Apple's directions to restore the system from the recovery partition and 
> a good backup of user files.
> 
> - -- 
>  Ned Deily,
>  nad at acm.org
> 
> - -- 
> https://mail.python.org/mailman/listinfo/python-list
> 
> ------- End of Forwarded Message
> 
> So please type
> 
> /usr/bin/python2.7 -c 'import sys;print(sys.version)'
> 
> and tell me what you get as an answer.
> 
> Then type
> 
> /usr/bin/python2.7 -c 'import numpy;print(numpy.__file__)'
> 
> and again tell me what you get.
> 
> But if it isn't as Ned expects, then you may have to go back to
> your backups.
> 
> Laura


I was having this same problem, entered those commands and got this as a response:

MacBook-Pro:~ kacyjones$ /usr/bin/python2.7 -c 'import numpy;print(numpy.__file__)' 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
MacBook-Pro:~ kacyjones$ 
MacBook-Pro:~ kacyjones$ /usr/bin/python2.7 -c 'import sys;print(sys.version)' 
2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]

Any idea what that means for my system?



More information about the Python-list mailing list