Unable to import simplejson

15 views
Skip to first unread message

Mike Driscoll

unread,
Oct 30, 2009, 10:10:15 AM10/30/09
to GUI2Exe
Hi,

I've been trying to compile an executable with GUI2Exe that has
wxPython and simplejson. For reasons I don't understand, GUI2Exe
cannot import simplejson even though Python itself can. I tried with
GUI2exe 0.1.0, 0.4.0 and 0.5.0 with no luck.

Here's the path to simplejson:

c:\\python25\\lib\\site-packages\\simplejson-2.0.9-py2.5.egg\
\simplejson

I'm using Python 2.5 on Windows XP and I'm using the py2exe part of
GUI2Exe. The error given is:

Importerror: No module named simplejson

And yes, I tried including it specifically in the Python Modules
control and then I tried it in the Python Packages control. By the
way, I also have a feature request: It would be really cool if there
was a way to copy the traceback so I could have included it here, but
I couldn't find a way to do so.

Thanks,

- Mike

Mike Driscoll

unread,
Oct 30, 2009, 10:28:33 AM10/30/09
to GUI2Exe
I know it's bad form (and kind of weird to boot) to reply to oneself,
but I found a workaround here:

http://andrewgrossmanatwork.blogspot.com/2009/03/py2exe-cant-import-packages-that-should.html

It would seem that py2exe is rather stupid when it comes to egg files.
By unzipping the egg, py2exe can now import simplejson and add it to
my binary.

One other note. If you happen to use PyCrypto in your project and
don't specifically include it, GUI2Exe will error out with a
"RunTimeError: EndUpdateResource". The error doesn't tell you what the
problem is and Google's results tend to be about PyInstaller rather
than py2exe...so I just guessed and by including it, the binary was
created successfully.

Thanks,

- Mike
Reply all
Reply to author
Forward
0 new messages