ImportError: No module named MySQLdb

前端 未结 11 1240
难免孤独
难免孤独 2020-12-02 05:28

I am referring the following tutorial to make a login page for my web application. http://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out--net-29982

I

11条回答
  •  日久生厌
    2020-12-02 05:46

    I got this issue when I was working on SQLAlchemy. The default dialect used by SQLAlchemy for MySQL is mysql+mysqldb.

    engine = create_engine('mysql+mysqldb://scott:tiger@localhost/foo')
    

    I got the "No module named MySQLdb" error when the above command was executed. To fix it I installed the mysql-python module and the issue was fixed.

    sudo pip install mysql-python
    

提交回复
热议问题