Search code examples
mysqldjangopython-3.7

Failed to Build mysqlclient ,Wheel cannot build. pip install mysqlclient not working


The problem have been faced by many including myself. You cannot use the command pip install mysqlclient directly for the latest build for python 3.7.4 or any 3.7.X . It is mentioned on the PyPI website New versions of mySqlClient may not work with older wheel. Therefore you need an older mySqlClient.


Solution

  • The solution to this is simple : UPDATE: July 2020: Another problem,if for starter you are trying to work on windows with Python make sure your version of python is 64bit not 32 bit.

    If your python version is 64bit then you can follow along.(Make sure you read this first,it just explains the logic what the problem could be)

    The latest wheel update was of May 12 ,2019 Wheel Page

    This means that update of MySQLClient after that will create a problem. So use the mysqlclient verion before that date. Today the version before the latest wheel is of Feb of 2019 . mysqlclient release history

    Just go to there release history and select the appropriate package. You will get the direct command for pip install something like this. Copy it:

    pip install mysqlclient==1.4.2.post1
    

    paste that in your terminal.

    Command for previous version mysqlclient

    This method should work in future too.Always use the version of mysqlclient before the latest released wheel.