Problem: Failed to install mysql using pip command under windows
pip3 install MySQL-python
Prompt that you need to install the VC++ XX library, because pip3 installs and compiles things called to the bottom of the window.
Solution: Here we use the compiled whl package to install directly:
Here we use the compiled whl package for direct installation (download the whl package of mysql-client):
1. Download the whl you need: https://www.lfd.uci.edu/~gohlke/pythonlibs/
2. Use whl Install command to install:
pip3 install mysqlclient-1.3.12-cp35-cp35m-win_amd64.whl
Note that if the prompt file does not exist, it may be that the system configuration does not have a configuration path, and you can install it directly in the download directory.
3. Check whether it can be used:
Enter the python environment, enter the following command, no error is reported to prove that the installation is successful, and it can be used smoothly
import MySQLdb