Relative import error with py2exe

It seems that in your mf3.py you are importing beyond the top level. Let’s suppose that your project structure is as follows: folder/ main.py mod/ __init__.py components/ __init__.py expander.py language_id.py utilities/ __init__.py functions.py First make sure that main.py refers to the subpackages as: from mod.components.expander import * from mod.utilities.functions import * expander.py and language_id.py have … Read more

scipy with py2exe

This seems to be a problem common to py2exe and pyinstaller with scipy 0.11.0 as discussed here. The temporal solution given in that thread is to import the file manually: adding the following codes into your program def dependencies_for_myprogram(): from scipy.sparse.csgraph import _validation Problem solved for both pyInstaller and py2exe You can alternatively try including … Read more

Make a py2exe exe run without a console?

For one exe file, use this setup (taken from this answer): from distutils.core import setup import py2exe, sys, os sys.argv.append(‘py2exe’) setup( options = {‘py2exe’: {‘bundle_files’: 1, ‘compressed’: True}}, windows = [{‘script’: “single.py”}], zipfile = None, )

Hiding console window of Python GUI app with py2exe

Yep, it is possible. If I use setup(console=[‘__main__.py’], options={“py2exe”:{“includes”:[“sip”]}}) It creates a console app, however if I use setup(windows=[‘__main__.py’], options={“py2exe”:{“includes”:[“sip”]}}) it does not show console on .exe file. But output is dumped on main.exe.log file in the .exe folder. Be careful.