No matter what I do, IDLE will not work...

Ned Deily nad at acm.org
Thu Nov 10 19:27:33 EST 2011


In article 
<3c2688bd-4f87-4eb1-9b40-3cb536a2d8df at e3g2000vbs.googlegroups.com>,
 CAMERON ALLEY <cra5370 at g.rit.edu> wrote:
> Lemme preface this post by saying the following - I've taken my
> computer to the local IT office on RIT campus, asked a Computer
> Science professor specializing in Python, and posted my question on
> answers.yahoo.com (I don't know why I expected that to work...). I've
> also googled my problem multiple times and have not come up with
> anything newer than about 4 years ago.
> 
> Okay, so the problem. I tried to install Python 2.7 about two months
> ago on both my laptop and iMac. Both are running up-to-date Mac OS X
> 10.6, with 64-bit processors and around 2.4GHz speed and 2G of RAM. My
> laptop installed python 2.7 and ran it perfectly, first time. My
> desktop... not so much.
> 
> How to recreate the issue on iMac - try to open IDLE, or in terminal,
> type the following:
> python
> import turtle
> turtle.up()
> 
> This is what's displayed in terminal:
> 
> COMPUTERNAME:~ USER$ python
> Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import turtle
> >>> turtle.up()
> CGColor with 1 components
> Abort trap
> COMPUTERNAME:~ USER$

That's an odd one; I've not seen a crash like that before.  From the 
crash dump, it is clear that the crash is happening inside of Tk, not 
Python, and, judging from the symbol names, it has something to do with 
menu initialization and colors.

Try running the same Turtle test using the Apple-supplied Python 2.6

  /usr/bin/python2.6

The Apple-supplied Tcl/Tk that it uses is known to have a number of 
serious problems and should not be used for serious work but, for me, it 
will bring up the turtle window in Tk without crashing.  If it crashes 
the same way that 2.7.2 does, then that would be pretty solid 
corroboration that the problem is not in Python and more likely an issue 
with Tk.

My first question would be do you have some third-party OS X app or 
extension installed that alters or colors menus?  I know there used to 
be some popular ones out there in the past.  If not, try opening System 
Preferences, select Displays, select Color, and check which display 
profile is selected.  Perhaps try selecting another.  And are you using 
a specific language in System Preferences -> Languages & Text -> 
Language?

If that doesn't help, try running the following commands in a terminal 
window:

  source /Library/Frameworks/Tk.framework/Versions/8.5/tkConfig.sh
  echo $TK_VERSION $TK_PATCH_LEVEL

You should see something like:

  8.5 .11

If not, double check that you really are using the latest ActiveState 
Tcl/Tk 8.5 installer from here:

  http://www.activestate.com/activetcl/downloads

Then try the failing turtle commads again and in the crash report, 
verify that  /Library/Frameworks/Tk.framework/Versions/8.5/ appear as 
framework paths and *not*  
/System/Library/Frameworks/Tk.framework/Versions/8.5/.

Try the following command which may not work if you don't have Xcode 
tools installed:

  otool -L $(python2.7 -c 'import _tkinter; print(_tkinter.__file__)')

The paths reported again should start with  
/Library/Frameworks/Tk.framework and not 
/System/Library/Frameworks/Tk.framework.

If none of that works, you could try installing the other python.org 
2.7.2 installer, the 32-bit-only one, which is linked to the older 
Tcl/Tk 8.4, which uses Carbon interfaces rather than Cocoa, and see what 
happens with it.

In any case, please report back what you find and, if necessary, open an 
issue on the Python bug tracker:
  http://bugs.python.org/

Thanks!

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list