Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #397 (closed defect: fixed)

Opened 22 months ago

Last modified 21 months ago

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:1 Changed 22 months ago by matysek

  • Status changed from new to assigned

This is because pyinstaller hook for sqlalchemy includes modules

sqlalchemy.databases.*

However, for 0.7 it should include also modules

sqlalchemy.dialects.*

because there was a module name change in sqlalchemy.

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.

comment:7 Changed 21 months ago by arakimaru@…

comment:8 Changed 21 months ago by matysek

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in r1581.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.