I am using python 3.6 within Anaconda. I am trying to connect to mySQL 5.7 through SQLAlchemy as mysql.connector flavor='mysql' is deprecated in the newest version.(I am able to connect to the database when I use python 3.4 and am able to use the flavor=mysql optoin to do inserts into the database through pandas).
I am trying to do the same via this SQLAlchemy engine method. But I am not able to connect.
Here is my code:
import sqlalchemy as sa
engine= sa.create_engine("mysql+mysqldb://user:password@localhost/databasename")
I get the following error:
ModuleNotFoundError: No module named 'MySQLdb'
Please help.
Thanks!