Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making exe using py2exe + sqlalchemy + mssql

I have a problem with making exe using py2exe. In my project i'm using sqlalchemy with mssql module. My setup.py script looks like:

from distutils.core import setup
import py2exe


setup(
  windows=[{"script" : "pyrmsutil.py"}],
  options={"pyrmsutil" : {
    "includes": ["sqlalchemy.dialects.mssql", "sqlalchemy"],
    "packages": ["sqlalchemy.databases.mssql", "sqlalchemy.cresultproxy"]
}})

But when i'm starting procedure like: python.exe setup.py py2exe

I'm receiving build log with following errors: The following modules appear to be missing ['_scproxy', 'pkg_resources', 'sqlalchemy.cprocessors', 'sqlalchemy.cresultproxy']

And in "dist" folder i see my pyrmsutil.exe file, but when i'm running it nothing happens. I mean that executable file starts, but do nothing and ends immediately without any pyrmsutil.exe.log. It's very strange.

Can anybody help me with this error?

like image 606
fryme Avatar asked Feb 02 '26 07:02

fryme


1 Answers

I know it's no an answer per se but have you tries pyInstaller? I used to use py2exe and found it tricky to get something truly distributable. pyInstaller requires a little more setup but the docs are good and the result seems better.

For solving this issue you could try searching for the mentioned dlls and placing them in the folder with the exe, or where you build it.

like image 137
theheadofabroom Avatar answered Feb 03 '26 21:02

theheadofabroom