0

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
1
  • Have you pip-installed flask-mysqldb? Commented Jul 25, 2022 at 6:30

1 Answer 1

0

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"

  1. install flask_mysqldb according to the documentation
  • pip install flask-mysqldb.

  • from flask import Flask

  • from flask_mysqldb import MySQL

Reference: https://flask-mysqldb.readthedocs.io/en/latest/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.