Install the MySQLdb module in python under the window, prompting the need to install the VC++ XX library solution

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:

Installation prompt needs to install VC++ library error
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/
Choose to install the python version of the whl package yourself
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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326311366&siteId=291194637