I'm using python 3.10. I want to use MySQL database, but whenever I am trying to import the module it throws the error. I am using MAC OS. There are certain file for windows to import but I wasn't able to find solution for Mac OS.
ImportError: No module named flask_mysqldb
from flask_mysqldb import MySQL
do you have flask_mysqldb installed on your work environment? if not
Create a virtual environment for your script using the command
pip3 install virtualenv
virtualenv "desired name for virtual environment"
pip install flask-mysqldb.
from flask import Flask
from flask_mysqldb import MySQL
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.