Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot import name 'Bootstrap5' from 'flask_bootstrap'?

I am trying to import Bootstrap5 from flask_bootstrap in my Python code on a Mac M1 using Python3. However, I get an import error saying that the name Bootstrap5 cannot be imported from flask_bootstrap. Here's the code snippet:

 from flask import Flask, flash, jsonify

 from flask_bootstrap import Bootstrap5

and I get this error

cannot import name 'Bootstrap5' from 'flask_bootstrap'

I can import bootstrap without any issues, but not Bootstrap5. What could be causing this problem and how can I fix it?

like image 460
MeravigliaTitti Avatar asked Oct 24 '25 14:10

MeravigliaTitti


1 Answers

follow the instructions on https://bootstrap-flask.readthedocs.io/en/stable/basic/#installation

pip uninstall flask-bootstrap bootstrap-flask
pip install bootstrap-flask
like image 200
ajspaghetti Avatar answered Oct 26 '25 03:10

ajspaghetti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!