Python Forum

Full Version: Flask_table module compatibility issue: cannot import name 'Markup' from 'flask'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Team,
We are using flask_table module in one of our python flask application , After upgrade to latest version of flask 3.0.2 then we are getting
below error and observed still flask_table=0.5.0 version.

Instead of downgrading flask modules, Could we expect upgraded version of flask_table soon ?.

Could you please suggest the solution.

Error:
[Thu Mar 07 04:35:52.553399 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask_table import Table, Col, LinkCol, DateCol
[Thu Mar 07 04:35:52.553405 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/__init__.py", line 1, in <module>
[Thu Mar 07 04:35:52.553408 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from .table import Table, create_table
[Thu Mar 07 04:35:52.553411 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/table.py", line 5, in <module>
[Thu Mar 07 04:35:52.553413 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask import Markup
[Thu Mar 07 04:35:52.553425 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] ImportError: cannot import name 'Markup' from 'flask' (/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask/__init__.py)
(Mar-21-2024, 11:51 AM)venkateshbalagiri Wrote: [ -> ]Hi Team,
We are using flask_table module in one of our python flask application , After upgrade to latest version of flask 3.0.2 then we are getting
below error and observed still flask_table=0.5.0 version.

Instead of downgrading flask modules, Could we expect upgraded version of flask_table soon ?.

Could you please suggest the solution.

Error:
[Thu Mar 07 04:35:52.553399 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask_table import Table, Col, LinkCol, DateCol
[Thu Mar 07 04:35:52.553405 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/__init__.py", line 1, in <module>
[Thu Mar 07 04:35:52.553408 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from .table import Table, create_table
[Thu Mar 07 04:35:52.553411 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/table.py", line 5, in <module>
[Thu Mar 07 04:35:52.553413 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask import Markup
[Thu Mar 07 04:35:52.553425 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] ImportError: cannot import name 'Markup' from 'flask' (/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask/__init__.py)
(Mar-21-2024, 11:51 AM)venkateshbalagiri Wrote: [ -> ]Hi Team,
We are using flask_table module in one of our python flask application , After upgrade to latest version of flask 3.0.2 then we are getting
below error and observed still flask_table=0.5.0 version.

Instead of downgrading flask modules, Could we expect upgraded version of flask_table soon ?.

Could you please suggest the solution.

Error:
[Thu Mar 07 04:35:52.553399 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask_table import Table, Col, LinkCol, DateCol
[Thu Mar 07 04:35:52.553405 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/__init__.py", line 1, in <module>
[Thu Mar 07 04:35:52.553408 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from .table import Table, create_table
[Thu Mar 07 04:35:52.553411 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] File "/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask_table/table.py", line 5, in <module>
[Thu Mar 07 04:35:52.553413 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] from flask import Markup
[Thu Mar 07 04:35:52.553425 2024] [wsgi:error] [pid 3584842:tid 140662083135232] [client 10.21.18.136:56476] ImportError: cannot import name 'Markup' from 'flask' (/autohome/www/cgi-bin/Common/flaskenv/lib/python3.8/site-packages/flask/__init__.py)
In our Flask project, we are utilizing Flask Table (0.5.0), but we are receiving an issue when we upgraded to Flask 3.0.2. Is an upgraded version of Flask Table on the horizon, as opposed to a downgrade to Flask?

Error:

Error:
ImportError: cannot import name 'Markup' from 'flask'
Are you able to offer a solution?
The project looks not maintained for a long time. Current version (the one you use) is from 2017.
There is issues in the repo since 3 Oct 2023 and even a pull request #141 from Jan 2024, but no reaction from owner/maintainer.
https://github.com/plumdog/flask_table/issues/137
I wouldn't hope it will be merged and problem(s) fixed anytime soon.
There is second one-line pull request #142 that fixes just that issue
https://github.com/plumdog/flask_table/pull/142/

You could apply this change in your code base
https://github.com/plumdog/flask_table/p...9d711113b3