Error publishing app on hosting

Hello,
Does anyone know what the following error means?

/usr/local/gems/gems/passenger-6.0.12/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import sys, os, re, imp, threading, signal, traceback, socket, select, struct, logging, errno
Traceback (most recent call last):
  File "/usr/local/gems/gems/passenger-6.0.12/src/helper-scripts/wsgi-loader.py", line 369, in <module>
    app_module = load_app()
                 ^^^^^^^^^^
  File "/usr/local/gems/gems/passenger-6.0.12/src/helper-scripts/wsgi-loader.py", line 76, in load_app
    return imp.load_source('passenger_wsgi', startup_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/qwertgolmar/.local/lib/python3.11/imp.py", line 172, in load_source
    module = _load(spec)
             ^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 721, in _load
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/qwertgolmar/www/app_flask/app.py", line 6, in <module>
    from flask import Flask, render_template, request, redirect, url_for, flash
ModuleNotFoundError: No module named 'flask'

I’m trying to load my app on a hosting with python3.11 (it’s the one I have locally) and after launching
./python3 -m pip install -r ~/www/app_flask/requirements.txt
to install all modules.
Thank you.

Looks like flask didn’t install properly. Can you post the contents of your requirements.txt please?

If I do a pip list I get installed.

blinker==1.6.2
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
cryptography==40.0.2
Flask==2.3.2
Flask-Login==0.6.2
Flask-MySQLdb==1.0.1
Flask-WTF==1.1.1
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.2
msal==1.22.0
mysqlclient==2.1.1
Pillow==9.5.0
pycparser==2.21
PyJWT==2.7.0
python-utils==3.6.0
requests==2.31.0
typing_extensions==4.6.2
urllib3==2.0.2
utils==1.0.1
Werkzeug==2.3.4
WTForms==3.0.1

What is in your requirements.txt though?

what is shown in the previous comment is the requirements.txt

Is it, or is it the output of pip list?

is the file requirements.txt

I solved more or less the above although I still have problems. Right now let’s say the application starts but when it goes to the login screen (it does it automatically if you’re not registered), I get all these errors in the server logs.

App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
App 1833644 output:   File "/home/qwertgolmar/www/app.py", line 58, in login
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/templating.py", line 151, in render_template
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/templating.py", line 132, in _render
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
App 1833644 output:   File "/home/qwertgolmar/www/templates/auth/login.html", line 1, in top-level template code
App 1833644 output:   File "/home/qwertgolmar/www/templates/base.html", line 16, in top-level template code
App 1833644 output:   File "/home/qwertgolmar/www/templates/auth/login.html", line 27, in block 'body'
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/utils.py", line 83, in from_obj
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
App 1833644 output:   File "/home/qwertgolmar/www/app.py", line 58, in login
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/templating.py", line 151, in render_template
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/flask/templating.py", line 132, in _render
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
App 1833644 output:   File "/home/qwertgolmar/www/templates/auth/login.html", line 1, in top-level template code
App 1833644 output:   File "/home/qwertgolmar/www/templates/base.html", line 16, in top-level template code
App 1833644 output:   File "/home/qwertgolmar/www/templates/auth/login.html", line 27, in block 'body'
App 1833644 output:   File "/home/qwertgolmar/.local/lib/python3.9/site-packages/jinja2/utils.py", line 83, in from_obj

the local application does not show any errors… in the hosting it does not even reach the login part.
do you know what it means?

Does anyone know what these errors mean?

App 306039 output:   File "/home/qwertgolmar/www/templates/login.html", line 1, in top-level template code
App 306039 output:   File "/home/qwertgolmar/www/templates/base.html", line 16, in top-level template code
App 306039 output:   File "/home/qwertgolmar/www/templates/login.html", line 27, in block 'body'

After many tests, I see that the problem is in the code

{% extends 'base.html' %}
{% block title %}Login{% endblock %}
{% for message in messages %}
{% endfor %}

For some reason the hosting does not read it correctly and it gives an error but locally it works fine for me.

is there any reason?