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
- First download the resource file mysqlclient‑1.4.6‑cp37‑cp37m‑win32.whl .
- Open the command line in the path where the resource is located and use the following command to install:
- pip install mysqlclient-1.4.6-cp37-cp37m-win32.whl
Successful installation