Problem Statement:
Pip Install mysql-python==1.2.5
The following error occurred:
C:\Users\Administrator\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,‘final‘,1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python27\include -Ic:\progra~2\jetbra~1\python~1\saplat~1\PC /Tc_mysql.c /Fobuild\temp.win-amd64-2.7\Release\_mysql.obj /Zl _mysql.c _mysql.c(42) : fatal error C1083: Cannot open include file: ‘config-win.h‘: No such file or directory error: command ‘C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe‘ failed with exit status 2
Operating Environment:
Windows Ten x64
Python 2.7.14
Pip 9.0.1
Workaround:
See PIP installation error about "MySQL Connector C 6.0.2", need to install the corresponding driver package, see below,
After you install Python under Win7 and want to install Python-mysql, the following issues occur with PIP installation:
Pip Install Mysql-python
build\lib.win-amd64-2.7\_mysql.pyd : fatal error LNK1120: 56 unresolved externalserror: command ‘C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\link.exe‘ failed with exit status 1120
The general explanation on the web is that reinstalling MySQL and installing MySQL is the option to install C + + compilers ...
I have not tried, but it certainly does not work ah, I just want to install a python can be remotely connected to the MySQL package, tube local MySQL what? Some explanations are really fraught.
But in the error hints also thanks to the lack of C + + environment, and later found on the Internet method:
Here's how:
1. In http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python download the corresponding package version, if it is Win7 64 bit 2.7 version of Python, download
Mysql_python-1.2.5-cp27-none-win_amd64.whl
Then execute pip install MYSQL_PYTHON-1.2.5-CP27-NONE-WIN_AMD64.WHL at the command line
Of course you need to jump to the directory under CMD to download MYSQL_PYTHON-1.2.5-CP27-NONE-WIN_AMD64.WHL
And then the installation was successful Mysql-python
- Reference Links:
Http://www.cnblogs.com/fnng/p/4115607.html
Windows Python Mysql-python installation process