ImportError: No module named MySQLdb

前端 未结 11 1249
难免孤独
难免孤独 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 06:06

    If you're having issues compiling the binary extension, or on a platform where you cant, you can try using the pure python PyMySQL bindings.

    Simply pip install pymysql and switch your SQLAlchemy URI to start like this:

    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://.....'
    

    There are some other drivers you could also try.

提交回复
热议问题