Fixing Python install on the Mac after running 'CleanMyMac'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fixing Python install on the Mac after running 'CleanMyMac'

MrJean1
FWIW, I recently upgraded an older MacBook to Mac OS X 10.7.5 and there are 3 different versions of Python in /System/Library/Frameworks/Python.framework, see:

$ ls /System/Library/Frameworks/Python.framework/Versions/
2.5 2.6 2.7 Current


It is unclear whether MacOS X 10.7.5 installed all four of these Python versions.  The older one(s) may be left over from the previous MacOS X release on the machine.  But all are Apple builds of the Python version, for example:

$ python2.7
Python 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)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D


In addition, there is a link in /usr/bin to the python2.X, pythonw2.X and python2.X-config file for each version, see

$ ls -la /usr/bin/python*
-rwxr-xr-x  2 root  wheel  62752 May 21 19:06 /usr/bin/python
-rwxr-xr-x  6 root  wheel    925 May 21 19:06 /usr/bin/python-config
lrwxr-xr-x  1 root  wheel     75 May 21 19:06 /usr/bin/python2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
lrwxr-xr-x  1 root  wheel     82 May 21 19:06 /usr/bin/python2.5-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config
lrwxr-xr-x  1 root  wheel     75 May 21 19:06 /usr/bin/python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x  1 root  wheel     82 May 21 19:06 /usr/bin/python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
lrwxr-xr-x  1 root  wheel     75 May 21 19:06 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x  1 root  wheel     82 May 21 19:06 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x  2 root  wheel  62752 May 21 19:06 /usr/bin/pythonw
lrwxr-xr-x  1 root  wheel     76 May 21 19:06 /usr/bin/pythonw2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5
lrwxr-xr-x  1 root  wheel     76 May 21 19:06 /usr/bin/pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
lrwxr-xr-x  1 root  wheel     76 May 21 19:06 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7


Perhaps you can reinstall these Pythons from the CD which came with the Mac.  Let me know if you need  more info.

/Jean




On Thursday, May 28, 2015 at 11:47:52 PM UTC-4, Laura Creighton wrote:

> webmaster at python.org just got some mail from some poor embarrased
> soul who ran this program and broke their Python install.
>
> They are running Mac OSX 10.7.5
>
> 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.
>
> So https://docs.python.org/2/using/mac.html says:
>
>    The Apple-provided build of Python is installed in
>    /System/Library/Frameworks/Python.framework and /usr/bin/python,
>    respectively. You should never modify or delete these, as they are
>    Apple-controlled and are used by Apple- or third-party software.
>
> So, I assume this poor soul has done precisely that.
>
> What do I tell her to do now?
>
> Laura


Reply | Threaded
Open this post in threaded view
|

Fixing Python install on the Mac after running 'CleanMyMac'

Ned Deily
In article <bffd4736-f9ff-492e-9069-836f6e7867d8 at googlegroups.com>,
 MrJean1 <MrJean1 at gmail.com> wrote:

> FWIW, I recently upgraded an older MacBook to Mac OS X 10.7.5 and there are 3
> different versions of Python in /System/Library/Frameworks/Python.framework,
> see:
>
> $ ls /System/Library/Frameworks/Python.framework/Versions/
> 2.5 2.6 2.7 Current
> >
> It is unclear whether MacOS X 10.7.5 installed all four of these Python
> versions.  The older one(s) may be left over from the previous MacOS X
> release on the machine

For compatibility with applications linked on older OS X releases, Apple
customarily ships more than one version of Python frameworks with OS X.  
There are actually three versions of the system Python frameworks there:
you should see that "Current" is actually a symbolic link to "2.7".  All
of those versions are shipped as part of OS X 10.7.

--
 Ned Deily,
 nad at acm.org



Reply | Threaded
Open this post in threaded view
|

Fixing Python install on the Mac after running 'CleanMyMac'

MrJean1
In reply to this post by MrJean1
Correct, the "Current" version is just a link to "2.7".  Also, the binaries '/usr/bin/python{,w}" seem to be copies of the "/System/Library/.../Versions/2.7/bin/python{,w}" files.

/Jean


On Friday, May 29, 2015 at 2:01:05 PM UTC-4, Ned Deily wrote:

> In article <bffd4736-f9ff-492e-9069-836f6e7867d8 at googlegroups.com>,
>  MrJean1 <MrJean1 at gmail.com> wrote:
> > FWIW, I recently upgraded an older MacBook to Mac OS X 10.7.5 and there are 3
> > different versions of Python in /System/Library/Frameworks/Python.framework,
> > see:
> >
> > $ ls /System/Library/Frameworks/Python.framework/Versions/
> > 2.5 2.6 2.7 Current
> > >
> > It is unclear whether MacOS X 10.7.5 installed all four of these Python
> > versions.  The older one(s) may be left over from the previous MacOS X
> > release on the machine
>
> For compatibility with applications linked on older OS X releases, Apple
> customarily ships more than one version of Python frameworks with OS X.  
> There are actually three versions of the system Python frameworks there:
> you should see that "Current" is actually a symbolic link to "2.7".  All
> of those versions are shipped as part of OS X 10.7.
>
> --
>  Ned Deily,
>  nad at acm.org