librelist archives

« back to archive

PyInstaller w/ Flask

PyInstaller w/ Flask

From:
David McKeone
Date:
2012-10-07 @ 17:33
I was wondering if anyone has had any success with freezing a Flask 
application with PyInstaller.

I've already worked around one part by removing the import code in 
Werkzeug's __init__.py.  Are there any best practices that I should keep 
an eye out for?

Thanks for any help.

__________________________________
David McKeone



Re: [flask] PyInstaller w/ Flask

From:
Armin Ronacher
Date:
2012-10-08 @ 23:44
Hi,

FWIW: the magic in __init__.py will soon be gone.


Regards,
Armin

Re: [flask] PyInstaller w/ Flask

From:
David McKeone
Date:
2012-10-09 @ 09:08
Thanks Armin, that'll certainly help in the long run, although I've 
managed to workaround it for now by changing all the imports to be static 
instead of dynamic.

My current issue is to figure out how to declare hidden imports such that 
PyInstaller sees some of the old-style extension imports, specifically 
flask-babel.  It doesn't seem to detect the -- from flask.ext.babel import
Babel -- syntax.  This is something else that will be fixed in the long 
run with the new -- from flask_babel import Babel -- syntax (like 
SQLAlchemy), but something I have to figure out for now.
__________________________________
David McKeone
Arts Management Systems Ltd.
mailto:david@artsman.com
http://www.artsman.com
Phone: (403) 536-1203 Fax: (403) 536-1210




On 2012-10-09, at 1:44 AM, Armin Ronacher wrote:

> Hi,
> 
> FWIW: the magic in __init__.py will soon be gone.
> 
> 
> Regards,
> Armin