Ticket #397 (closed defect: fixed)
packaging sqlalchemy 0.7.2 (mysql) does not include MySQLdb
| Reported by: | sebastianelsner@… | Owned by: | matysek |
|---|---|---|---|
| Priority: | normal | Milestone: | PyInstaller 2.0 |
| Component: | PyInstaller | Version: | develop |
| Severity: | normal | Keywords: | sqlalchemy, mysql |
| Cc: |
Description
I have been trying to package a sqlalchemy 0.7.2 program, which accesses a MySQL data source, with the latest PyInstaller? trunk (rev. 1571). PyInstaller? fails to include MySQLdb. Works fine with sqlalchemy 0.6.8. Workaround is to include MySQLdb explicitly.
Attachments
Change History
comment:2 Changed 22 months ago by matysek
I tried to fix it in r1572. Let us know if it works for you.
I also noticed that there are some statements like
__import__('MySQLdb')
and I'm not sure if pyinstaller would handle that automatically.
comment:3 Changed 22 months ago by anonymous
The fix did not work for me. I will try and investigate further next weekend.
comment:4 Changed 22 months ago by matysek
In that case we need to somehow directly find out what DB python modules (like MySQLdb, psycopg2) sqlalchemy uses and try to bundle them with packaged app.
comment:5 Changed 22 months ago by matysek
sqlalchemy 0.6+ allows to use multiple drivers to connect to one DB systems. Every driver has its own module (like sqlalchemy.dialects.mysql.mysqldb or 'sqlalchemy.dialects.mysql.pyodbc).
We would have to get the driver module names for all databases with code similar to:
driver_name = sqlalchemy.dialects.mysql.mysqldb.dialects.dbapi.__name__
and add driver_name to the importhooks for sqlalchemy.

This is because pyinstaller hook for sqlalchemy includes modules
However, for 0.7 it should include also modules
because there was a module name change in sqlalchemy.