-1

I am receiving that error when I am running this code: from flaskext.mysql import MySQL

Here is the error:

ModuleNotFoundError: No module named 'flaskext' 
  1. My Python version is 3.9
  2. I've MySQL DB installed.(While installing, my Python Connector is failed and according to here https://bugs.mysql.com/bug.php?id=101128, this is a MySql bug that still haven't be debugged.)
  3. I've also installed Flask-MySQL by pip install Flask-MySQL , MySQL connector by pip3 install mysql-connector-python and Flask-Ext by pip install Flask-Ext . All of them are successfully installed but I am still facing with same error.
  4. I tried every possible solution from ImportError: No module named flask.ext.mysql . How can I solve it? Thx in advance
davidism
  • 121,510
  • 29
  • 395
  • 339
Tevfik Sastım
  • 31
  • 1
  • 12

1 Answers1

0

You need to install flask-mysql package:

pip3 install flask-mysql
Lucas Campos
  • 98
  • 1
  • 7
  • I did but I am still receiving the same error – Tevfik Sastım Dec 16 '21 at 21:18
  • Did you created a virtualenv and activate to install the package? in windows it will be like: python3 -m venv venv. Then: .\venv\Scripts\activate After that you can install the packages, if you are using vscode remeber to pass the interpreter of the venv file – Lucas Campos Dec 17 '21 at 01:04
  • @TevfikSastım you're having trouble with setting up a virtual environment in VSCode here's a helpful answer: https://stackoverflow.com/questions/54106071/how-can-i-set-up-a-virtual-environment-for-python-in-visual-studio-code#54107016 – YJH16120 Dec 17 '21 at 02:35