关于python安装mysqldb模块的问题,请教,
本人电脑系统XP,
装IIS
python2.6
MySQL-python-1.2.3c1
MySQL Server 5.1
在安装MySQLdb时
之前出现过ImportError: No module named setuptools错误。
安装setuptools,然后我安装的是setuptools-0.6c8,过程没发现错误
然后再次安装MySQLdb
setup.py build
setup.py install
出现错误是:
running install
running build
running build_py
running build_ext
building '_mssql' extension
error: Unable to find vcvarsall.bat
请问是什么问题?
[解决办法]
好像是个 比较普遍的问题呢
参考下这个 Extension module build fails for MinGW: missing vcvarsall.bat
--this from http://bugs.python.org/issue2698--------
Here is the build with Python 2.6.2. It works now.
C:\pygame\bug2698>python setup.py build --compiler=mingw32 --verbose
running build
running build_ext
building 'simple' extension
creating build
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\python26\include
-IC:\python26\PC -c simple.c -o build\temp.win32-2.6\Release\simple.o
writing build\temp.win32-2.6\Release\simple.def
creating build\lib.win32-2.6
C:\mingw\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win32-2.6\Release\simple.o
build\temp.win32-2.6\Release\simple.def -LC:\python26\libs
-LC:\python26\PCbuild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\simple.pyd
-------------------------------
[解决办法]
应该是没装vc吧,所以进入编译步骤就会错。试试用现成已编译好的...
http://www.codegood.com/archives/4
[解决办法]
error: Unable to find vcvarsall.bat
找不到VC的环境变量设置批处理程序。装个vc就行了。
[解决办法]
沒有vc,可以下載免費版的vs2008.
要不下載編譯好的安裝庫。