Python help

For questions about using Classic.

Post » Sun Sep 18, 2011 6:42 am

I have a problem using python. I have a python script in my cap that uses xml.dom.minidom , and I get an error message when running my game:

Traceback (most recent call last):
File "<string>", line 2 in <module>
ImportError: No module named xml.dom.minidom


I got this to work before, but I had to reinstall my pc recently, and now I can't get it to work anymore.
I have python 2.6.6 installed in c:\python6\ , and the lib\xml\dom\minidom.py is right there.

What am I missing? It's driving me nuts.
B
4
G
3
Posts: 39
Reputation: 978

Post » Tue May 14, 2013 11:25 pm

Sorry for bumping an old thread, just making sure that anybody who wants the solution will find as much info as they can get.

I recently run into the "no module" ImportError, and figured out this:
- CC comes with some of the modules preloaded in the ..CC\DATA\Python directory
- some of it, like my base64 module are missing
- download Python 2.6, install it, find the modules that you're lacking
- if you have only *.py files, you have to convert them into *.pyc files (probably)
- to do that, use Python! [import py_compile / py_compile.compile("base64.py")]
- copy the *.pyc file (module) that you're missing into ..CC\DATA\Python directory
- import and enjoy, should work :)

My original problem and the extended solution: http://www.scirra.com/forum/topic67855.html.

Cheers!bitworks2013-05-14 23:26:41
B
4
S
1
Posts: 28
Reputation: 435


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests