Search code examples
pythonmacososx-yosemitepython-idle

Can't make IDLE working on Mac


I have been looking for some answer about this IDLE problem and I tried the suggested solution but nothing worked.

I am on OSX yosemite and I want to learn python so I downloaded Python 3.4.3 and the ActiveState Tcl recommended 8.5.17.

The problem is that IDLE closes instantaneously without any window appearance. I have tried to open it from the terminal and I got this error message ( Which is the one that a lots of people got):

Last login: Thu Mar  5 11:36:01 on ttys000
mac-mini-de-local-administrator:~ laurent$ /Applications/Python\ 3.4/IDLE.app/Contents/MacOS/IDLE ; exit;
Traceback (most recent call last):
File "/Applications/Python 3.4/IDLE.app/Contents/Resources/idlemain.py", line 75, in <module>
main()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/PyShell.py", line 1564, in main
    shell = flist.open_shell()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/PyShell.py", line 323, in open_shell
    self.pyshell = PyShell(self)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/PyShell.py", line 871, in __init__
    OutputWindow.__init__(self, flist, None, None)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/OutputWindow.py", line 16, in __init__
    EditorWindow.__init__(self, *args)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/EditorWindow.py", line 169, in __init__
    self.apply_bindings()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/EditorWindow.py", line 1109, in apply_bindings
    text.event_add(event, *keylist)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/idlelib/MultiCall.py", line 374, in event_add
    widget.event_add(self, virtual, seq)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1487, in event_add
    self.tk.call(args)
_tkinter.TclError: bad event type or keysym "Command"
logout

[Opération terminée]

At the first download, IDLE was working, at this time I modified in preferences something to be able to write a backslash. as suggested here:

How do I make backslash (\) work in IDLE?

But at the second opening IDLE was not working anymore. After re-installing python and Tcl several times, It was impossible to get IDLE works.

While reinstalling I also deleted all the files in the folder related to Python and Tcl created in the folder 'Library' and 'Library\Framworks' because apparently some saved preferences can be located there but the problem persists.

Any help would be much appreciated, I am very new to python so I may not understand everything well.

Thanks a lot in advance

Laurent


Solution

  • The traceback (and your reported history) suggests that the problem is your modification to key preferences. User modifications are stored in $HOME/.idlerc/, where $HOME is the user-specific home directory. I am not familiar with Mac but I am sure that $HOME is not in Library/, so you likely did not delete .idlerc. The particular file you need to delete is config-keys.cfg.