ImportError: No module named MySQLdb

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

    So I spent about 5 hours trying to figure out how to deal with this issue when trying to run

    ./manage.py makemigrations
    

    With Ubuntu Server LTS 16.1, a full LAMP stack, Apache2 MySql 5.7 PHP 7 Python 3 and Django 1.10.2 I really struggled to find a good answer to this. In fact, I am still not satisfied, but the ONLY solution that worked for me is this...

    sudo apt-get install build-essential python-dev libapache2-mod-wsgi-py3 libmysqlclient-dev
    

    followed by (from inside the virtual environment)

    pip install mysqlclient
    

    I really dislike having to use dev installs when I am trying to set up a new web server, but unfortunately this configuration was the only mostly comfortable path I could take.

提交回复
热议问题