0

When I connect my SQLAlchemy to flask app, it gives me the following error

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 152, in import_dbapi
    return __import__("MySQLdb")
           ^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'MySQLdb'
joseph
  • 871
  • 1
  • 6
  • 18
  • Did you installed the MySQLdb package in the environment where you are running your app? – Navkar Jain Jul 28 '23 at 19:01
  • Does this answer your question? [ModuleNotFoundError: No module named 'MySQLdb'](https://stackoverflow.com/questions/53024891/modulenotfounderror-no-module-named-mysqldb) – Harris Minhas Aug 04 '23 at 04:22

1 Answers1

0

Try running pip install MySQL-python. Here are the docs for it PyPi MySQL Docs. Make sure this package supports your system architecture and that your version of python supports this package.