Python 3.7, Failed building wheel for MySql-Python

前端 未结 11 1459
忘了有多久
忘了有多久 2020-12-14 08:53

I am new to python and I am trying django framework that involves some MySql and ran into this error when try to do pip install mysqlclient and down the lines o

相关标签:
11条回答
  • 2020-12-14 09:15

    currently the mysql-connector for python 3.7 is not available in official wesite but u can fix this issue by installing wheel with specific windows and python version. this solutionpip install (ex/dir)/mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl for win 64-bi and python 3.7

    check the link below and download the specific wheel for your system. download and install the wheel for specific version by using "pip install (full path with file name in my case ex:-"pip install C:\Users\%user%\Downloads\mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl")

    0 讨论(0)
  • 2020-12-14 09:15

    You have to install "mysqlclient-1.4.1-cp37-cp37m-win32.whl" (32bit) file

    1. Download 32bit file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
    2. if your file is in Downloads folder write the command in your cmd

      i. cd C:\Users\Nour Noby\Downloads ["Nour Noby" should be changed ]

      ii. pip install mysqlclient-1.4.1-cp37-cp37m-win32.whl ["mysqlclient-1.4.1-cp37-cp37m-win32.whl" should be replaced with your downloaded filename ].

    0 讨论(0)
  • 2020-12-14 09:19

    In my case, I had the 32-bit version of Python installed, instead of the 64-bit one. Install 64-bit Python and it would work alright.

    0 讨论(0)
  • 2020-12-14 09:22

    You need to install the following dependencies before installing mysqlclient for python 3.7 in your system.

    sudo apt-get install python3.7-dev default-libmysqlclient-dev

    I hope this will help you.

    0 讨论(0)
  • 2020-12-14 09:23

    As of 2019, here is how to run smoothly pip install mysqlclient on MacOS:

    brew info openssl and follow the commands at the bottom

      echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
    

    Other approaches:

    • brew install/upgrade/reinstall mysql : did not fix the issue for me, but has the nice side effect to make sure your installation is clean.
    • brew install mysql-connector-c : to make that work you have to unlink mysql, which ruins your setup and it did not fix the issue for me.
    0 讨论(0)
提交回复
热议问题