0

I'm trying to import the easygui module into Visual Studio Python Tools, but thus far I have been unable to get it to work. Whenever I run anything involving importing easygui I get the following error:

Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 1
06, in exec_file
exec_code(code, file, global_variables)
File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.1\visualstudio_py_util.py", line 8
2, in exec_code
exec(code_obj, global_variables)
File "C:\Users\dan\documents\visual studio 2013\Projects\MoreGuiTests\MoreGuiT
ests\MoreGuiTests.py", line 1, in <module>
from easygui import *
File "C:\Users\dan\documents\visual studio 2013\Projects\MoreGuiTests\MoreGuiT
ests\easygui.py", line 155, in <module>
from Tkinter import *
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 is not a valid Win32 application.

I've tried several downloads of easygui, both version .96 and .97, with one of the .96 versions having a setup.py. The other ones just have a easygui.py file and a init.py file. I've tried installing them through command prompt and importing them Visual Studio, however I haven't been able to get anything to work. I've also tried putting copies of the easygui.py and init.py into the project folder, however I would still get the same errors. I've been using Python 2.7. Any help would be greatly appreciated.

UPDATE: The problem was due to an difference in types between Python and _tkinter (x32, x64). Reinstalling Python fixed this problem.

jruizaranguren
  • 12,679
  • 7
  • 55
  • 73
Dan F
  • 27
  • 1
  • 5
  • I'm sorry for the difficulty. A previous question has the same symptoms (not necessarily the same fix): http://stackoverflow.com/questions/8724729/python-tkinter-on-windows – Robert Lugg Dec 23 '14 at 22:34
  • This appears to be an issue with your Python install. easygui uses Tkinter underneath. Please take a look at the previous question referenced in my previous comment. There are other resources if you Google the last six lines of your error message. – Robert Lugg Dec 23 '14 at 22:42

0 Answers0