Error: while importing 'app', an ImportError was raised: ImportError: cannot import name 'Markup' from 'flask'

53 views Asked by At

I am quite a beginner in Python but I'm desperately looking for a solution for the problem that

Markup cannot be imported from "flask"

Context: for a project at university, I am trying to build a flask application. I am set by now and got no errors until the end when I wanted to run flask and this error appears.

The traceback looks like this:

File "C:\Users\phili\PycharmProjects\pythonProject16\venv\Lib\site-packages\flask\cli.py", line 247, in locate_app
    __import__(module_name)

  File "C:\Users\phili\PycharmProjects\pythonProject16\app\__init__.py", line 11, in <module>
    from app import routes, models

  File "C:\Users\phili\PycharmProjects\pythonProject16\app\routes.py", line 1, in <module>
    from app import app, tables, models

  File "C:\Users\phili\PycharmProjects\pythonProject16\app\tables.py", line 1, in <module>
    from flask_table import Table, Col

  File "C:\Users\phili\PycharmProjects\pythonProject16\venv\Lib\site-packages\flask_table\__init__.py", line 1, in <module>
    from .table import Table, create_table

  File "C:\Users\phili\PycharmProjects\pythonProject16\venv\Lib\site-packages\flask_table\table.py", line 8, in <module>
    from .columns import Col

  File "C:\Users\phili\PycharmProjects\pythonProject16\venv\Lib\site-packages\flask_table\columns.py", line 3, in <module>
    from flask import Markup, url_for

These are the installed packages:

enter image description here enter image description here

I almost read every thread asked Ai but no solution was suitable from my point of view.

Due to I am as I said a beginner the solution might be pretty simple but i cannot find it.

Thanks in advance and I hope the provided information is enough.

I tried to reinstall the packages, tried to change the code which was related to the Markup-order, read threads but nothing worked for me.

0

There are 0 answers