Currently downloaded MYSQLDB under window does not have EXE installation package, only the source code.
Install with the Python setup.py install command,
The error is as follows:
The exception information is as follows:
f:\devtools\mysql-python-1.2.3>pythonsetup.py Build
Traceback (most recent):
File "setup.py", line <module>
metadata, Options = Get_config ()
File "F:\devtools\MySQL-python-1.2.3\setup_windows.py", Line7, in Get_config
Serverkey = _winreg. Openkey (_winreg. HKEY_LOCAL_MACHINE, options[' Registry_ke
Y '])
Windowserror: [Error 2] The system cannotfind the file specified
Workaround:
In fact, the analysis of the code, found just looking for MySQL installation address only modified setup_windows.py as follows
Note Two lines, add a line, for the first step MySQL installation location
#serverKey = _winreg. Openkey (_winreg. hkey_local_machine,options[' Registry_key ')
#mysql_root, dummy = _winreg. QueryValueEx (Serverkey, ' location ')
Mysql_root = r "F:\devtools\MySQL\MySQL Server 5.5"
When you are finished, install again,
The error is as follows
unable to find Vcvarsall.bat error
The first type:
First install the MinGW;
Add the MinGW path to the environment variable path, such as MinGW installed in D:\MinGW\, add D:\MinGW\bin to path;
Open a command-line window and enter the directory where you want to install the code in the command-line window;
Enter the following command to install it. setup.py Install build--compiler=mingw32
The second type:
Today in the installation of the PYSCOPG2 Library when the unable to find Vcvarsall.bat error, on the internet for a while, some people say is to install MinGW to solve, I tried, but can not later find another solution:
1, to http://www.microsoft.com/express/Downloads/#2008-visual-cpp to download Visual C + + Express Edition
2, then install, and then re-python setup.py install.
This should be a common method, if you install other libraries when you encounter unable to find Vcvarsall.bat error, you should also be able to solve
Note: Do not download 2010, I do not know why, anyway, people say it seems to be 2010 No
Also: If you encounter mc.exe error when installing, then you need to add C:\Program Files\Microsoft Sdks\windows\v7.0a\bin to your PATH variable
The first is to use MinGW to compile this Python package with C, the second is VC inside the Vcvarsall.bat script, but these two methods are more troublesome, and to download so big things installed,
The first method was tested, no,
The second software is too big to download, there is no test.
Then directly on the network to find Mysqldb-python EXE file, directly installed on it. Save a lot of trouble.