2

There are a bunch of tools out there like pyInstaller, py2exe, etc. But none of them seems to work while making a Windows standalone executable for a Flask application.

Can someone guide me with proper instructions as to how one can create executable for a Flask application? I want to distribute the application as single clickable exe for end users.

To be specific, the application has following dependencies. - Flask - Sqlalchemy - Requests - Httplib2 - Database used is SQLite

I don't want to open the code as of now, but if someone has a good solution, I can send the project repo privately for testing purposes.

  • This is not a duplicate at all since python project with flask are known for having own specific methods for being converted into standalone executable – user11696358 Sep 10 '21 at 08:45

2 Answers2

1

Instead of trying to create a standalone executable for a flask app in windows, you should use docker in order to containerize/package your flask app (if it must be packaged).

Docker will give you something that is system agnostic, is well understood to work, and is in line with best practices.

melchoir55
  • 6,842
  • 7
  • 60
  • 106
  • 1
    Thanks. I will look into docker. Just one question. Can I make a standalone using Docker? I want to distribute the application to end users and not to developers. So I want to give a single clickable exe file to them. – Nishant Bhatia Jul 19 '17 at 07:00
0

I tried using pyinstaller that creates one executable of your python project: for more info you can refer this: https://stackoverflow.com/a/37140662/5114581

official website: http://www.pyinstaller.org/

Rohit Salunke
  • 1,073
  • 1
  • 10
  • 14
  • I know about pyInstaller, and I was able to work on it too on simple python files. But it seems to fail in case of Flask projects. Have you tried this with Flask? – Nishant Bhatia Jul 19 '17 at 07:16