Thursday, April 15, 2010

How to use SQLAlchemy & MySQL with py2exe

py2exe doesn't automatically detect the dependencies, so you have to explicitly tell it to include the modules in the setup function.

E.g.

from distutils.core import setup
import py2exe

setup(
    console=['myprog.py'],
    options=dict(
        py2exe=dict(
            includes=['sqlalchemy.databases.mysql', 'MySQLdb']
        )
    )
)

No comments: