#πŸ”’ Converting a flask app to an .exe file

4 messages Β· Page 1 of 1 (latest)

broken shell
#

I'm currently trying to convert my flask project ran through PyQT's webview into an exe file (It's a part of the project requirement so don't ask why D:)

However it returns this traceback error when I try to open gui.exe:

Traceback (most recent call last):
  File "gui.py", line 7, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "app.py", line 32, in <module>
    app = create_app(app_config)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "apps\__init__.py", line 42, in create_app
    register_blueprints(app)
  File "apps\__init__.py", line 23, in register_blueprints
    module = import_module('apps.{}.routes'.format(module_name))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "C:\Users\admin\Downloads\gui\_internal\apps\authentication\routes.py", line 15, in <module>
    from apps.authentication.forms import LoginForm, CreateAccountForm
  File "C:\Users\admin\Downloads\gui\_internal\apps\authentication\forms.py", line 6, in <module>
    from flask_wtf import FlaskForm
ModuleNotFoundError: No module named 'flask_wtf'

This is my prompt:

pyinstaller --noconfirm --onedir --windowed --add-data "C:\Users\admin\Downloads\nhandienhs\static;static/" --add-data "C:\Users\admin\Downloads\nhandienhs\nginx;nginx/" --add-data "C:\Users\admin\Downloads\nhandienhs\Attendance;Attendance/" --add-data "C:\Users\admin\Downloads\nhandienhs\apps;apps/" --add-data "C:\Users\admin\Downloads\nhandienhs\apps\__pycache__;__pycache__/" --add-data "C:\Users\admin\Downloads\nhandienhs\app.py;." --add-data "C:\Users\admin\Downloads\nhandienhs\haarcascade_frontalface_default.xml;." --add-data "C:\Users\admin\Downloads\nhandienhs\face_recognition_model.pkl;."  "C:\Users\admin\Downloads\nhandienhs\gui.py"
gleaming doveBOT
#

@broken shell

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

gleaming doveBOT
#

@broken shell

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.