If I use python script to do basic things then the EXE runs fine as long as the python26.dll is in the folder.
But I just tried using the random module and the exported EXE no longer works eventhough it runs fine within Construct.
My test script is very simple:
SEED = 123
System.SetGlobalVar('x', random.randrange(0, 100))[/code:djpa2kif]
When I run the EXE it complains something about random.pyc and about not finding __future__
So in the export wizard I tried checking the __future__ and random.pyc modules, which fixed the __future__ error but not the "random" one.
The error message it gives me is:
[i]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "random.pyc", line 43, in <module>
ImportError: No module named warnings[/i]
Can someone please point out what I'm doing wrong?
Develop games in your browser. Powerful, performant & highly capable.
There are a lot of modules you need to tick when exporting, because they build the basic functionality of Python. The easiest two ways are:
1) Just tick every pyc or pyo, this will work although there is a small overhead of never needed modules embedded in the exe
2) Trial&error, in your example error message, it wants warnings.pyc, so tick it export again and see the next error message to find the next module to embed, and so on, until there is no error message anymore.
Most basic modules almost always needed are
But this is not a complete list. Many modules depend on each other, so when using one module you might need to include a handful of other modules as well.