Mysqlclient installation error solution under Windows

When using pip to install mysqlclient, the following error occurred:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

The easiest solution is to download the wheel package manually

Download link: Archived: Python Extension Packages for Windows - Christoph Gohlke (uci.edu)

Go to this address to find the corresponding mysqlclient resource. You can use the shortcut key ctrl+f to search for mysqlclient.

Among them, cp37 corresponds to python3.7, and win64 represents windows 64-bit system.

Here, since the python3.7 version I downloaded at that time was 32bit, the whl package also needs to be 32bit to support it.

You can pay attention to your python version to avoid errors.

I choose mysqlclient‑1.4.6‑cp37‑cp37m‑win32.whl here

  1. First download the resource file mysqlclient‑1.4.6‑cp37‑cp37m‑win32.whl .
  2. Open the command line in the path where the resource is located and use the following command to install:
  3. pip install mysqlclient-1.4.6-cp37-cp37m-win32.whl

Successful installation

 

Guess you like

Origin blog.csdn.net/weixin_54106682/article/details/128160895