Solution: PIP install MySQL Python has the following problems

Question 1:
Error: Microsoft Visual C++ 9.0 is required
Install mysql-Python with PIP on Windows with the following error message and see http://aka.ms/vcPython27 for a solution
Error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
Open the http://aka.ms/vcpython27 will jump to http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
Download the installation package
Microsoft Visual C++ Compiler for Python 2.7
solves the problem after installation
Problem 2:
Resolve ‘C:\ Users\\Administrator\\AppData\\Local\\ Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\ Cl.exe ‘failed with exit 2

Error: Cannot open include file: ‘config-win.h’: No such file or Directory

Problem description:
pip instal MySQL-python
The following error occurs:

Operating environment:
Python 2.7.14
Setuptools 16.0
PIP 7.0.1
Operating system: Windows7.0.10240 64-bit

Solutions:
1) Install the mysql Connector. Install the 32-bit or 64-bit version of the system at the following download address:
http://dev.mysql.com/downloads/connector/c/6.0.html#downloads
2) install Microsoft Visual C++ Compiler for Python 2.7. If the installation of mysql-python requires even some vc runtime, the download address is:
http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
(refer to the previous blog: http://blog.csdn.net/xxm524/article/details/47360229)
Once the dependency software is installed as described above, running PIP Install mysql-Python again should succeed;
However, I encountered this problem again. After a careful look at the error message, I found the following prompts:

** Note * : If ‘C:\ Users\\Administrator\\AppData\\ Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\ cl.Exe ‘failed with exit 2 still appears, maybe the version you installed is different from your Python and PIP version, maybe Python is 32 bits, You have a 64-bit Connector installed
The mysql Connector installed was 64-bit and was installed in the Directory C:\Program Files \ mysql \ mysql Connector C 6.0.2. However, from the prompt I see that it wants to install to C:\Program Files (x86)\ mysql \ mysql Connector C 6.0.2, so a 32-bit mysql connector should be installed.


Reinstall the 32-bit mysql Connector, re-run PIP Install mysql-Python, and the installation was successful!
In summary, the main reason for this is that python and PIP are both 32-bits installed on the system.
Reference article:
http://www.cnblogs.com/yuguoguo/p/4089427.html
http://blog.csdn.net/xxm524/article/details/47360229

Read More: