3
votes

I currently switched from olldbg to ImmunityDebugger and realized that my IDLE didn't start any longer. Immunity Debugger installs itself a copy of Python (the newest one: 2.7), so I thought it wouldn't change anything important, since i had alerady 2.7 installed.

If I want to start IDLE manually (cmd -> "python.exe -m idlelib.idle") Mr. Cmd tells me following:

IDLE can't import Tkinter. Your Python may not be configured for Tk.

Then I ran python in the console and wanted to import Tkinter manually:

>>> import Tkinter
Traceback (most recent call last):   
File "<stdin>", line 1, in <module>   
File "C:\Python27\lib\lib-tk\Tkinter.py", line 38, in  <module>
import FixTk   
File "C:\Python27\lib\lib-tk\FixTk.py", line 65, in <module>
import _tkinter

ImportError: DLL load failed: %1 not a valid win32 application

Any Ideas what could be misconfigured? (Im using windows 7 64 Bit Home Edition) Nikolai

2
Is _tkinter.pyd in Python27\DLLs? tcl85.dll, tk85.dll? Is there a Python27\tcl directory? - Eryk Sun
Much appreciate your Help. everthing were it should be. (all your suggestions are positive - no dll or Directory is missing). The tcl directory seems 'full' too: oi43.tinypic.com/2vir0j5.jpg and oi43.tinypic.com/v7grya.jpg - Nikolai Tschacher
Is C:\Python27\DLLs in your sys.path? - Eryk Sun
Yeah, actually it is: >>> import sys >>> sys.path ['', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\ \lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27 ', 'C:\\Python27\\lib\\site-packages'] - Nikolai Tschacher
Try import _tkinter. If that fails, try: import os, ctypes; os.chdir(r'C:\Python27\DLLs'). Then try to load the DLLs: ctypes.cdll.LoadLibrary('tcl85.dll') and also ctypes.cdll.LoadLibrary('tk85.dll'). - Eryk Sun

2 Answers

0
votes

The install probably messed up the pythonpath, try to use virtualenv, than you install packages in it with pip. It's always recommended.

0
votes

It is possible that Immunity Debugger set the TCL_LIBRARY and TK_LIBRARY environment variables. See the first answer to Idle won't start