使用 wamp 的 mysql 安装 python-mysql
(我不确定是否应该在这里问这个问题还是SU..但是看到这个问题所以,我在这里问...)
我在我的vista机器上安装了wamp(mysql-5.1.33)服务器,我正在尝试安装python-mysql 1.2.3c1以使用mysql版本由 wamp 提供。
起初,当我运行python setup.py install
时,我收到一个错误,说它找不到mysql的bin文件夹的位置。查看setup_windows.py,我注意到它正在寻找注册表项,因此我添加了该注册表项,我认为它现在能够找到它。
但现在,当我运行 python setup.py install
时,我收到一个不同的错误,提示 Unable to find vcvarsall.bat
。
任何有关安装的帮助都值得赞赏。
这是python setup.py install
的输出:
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info\PKG-INFO
writing top-level names to MySQL_python.egg-info\top_level.txt
writing dependency_links to MySQL_python.egg-info\dependency_links.txt
reading manifest file 'MySQL_python.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.6\MySQLdb
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
非常感谢!
(I'm not sure if this should be asked here or SU.. but seeing this question on SO, I am asking it here...)
I have wamp (mysql-5.1.33) server setup on my vista machine, and I am trying to install python-mysql 1.2.3c1 to use the mysql version provided by wamp.
At first, when I ran python setup.py install
, I got an error saying it couldn't find the location of the mysql's bin folder. Looking into setup_windows.py
, I noticed it was looking for a registry key and so I added that registry entry and I think it is able to find it now.
But now, when I run python setup.py install
, I get a different error saying Unable to find vcvarsall.bat
.
Any help on installing this appreciated.
Here is the output of python setup.py install
:
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info\PKG-INFO
writing top-level names to MySQL_python.egg-info\top_level.txt
writing dependency_links to MySQL_python.egg-info\dependency_links.txt
reading manifest file 'MySQL_python.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.6\MySQLdb
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
原因是Python26\Lib\distutils中的msvc9compiler.py没有正确分析VC版本。您可以自己检查 msvc9compiler.py 中的 find_vcvarsall(version) :它总是变为 version = 9,意味着 VC9(2008) 可以工作,但决不能 VC8(2005)。使用 setup.py 和 VC8 编译某些东西的尴尬方法是在上面的函数中手动设置 version = 8,在构建和安装后将其恢复到旧版本。
The reason is msvc9compiler.py in Python26\Lib\distutils don't analyse VC version properly. You can check find_vcvarsall(version) in msvc9compiler.py yourself: it always turns version = 9, means VC9(2008) will work, but never VC8(2005). The awkward way to compile something using setup.py with VC8 is make version = 8 manually in the function above, after build and install recover it to old.
您可以使用 mysql-python 的 sourceforge 页面上提供的预编译二进制文件。
版本 1.2.2 具有 python2.4 和 python2.5 的二进制安装程序
如果您正在搜索 python2.6 二进制文件,请在此处找到它 - http://www.codegood.com/archives/4
You can use a precompiled binary available at sourceforge page of mysql-python.
The version 1.2.2 has the binary installer for python2.4 and python2.5
If you are searching for python2.6 binaries, find it here - http://www.codegood.com/archives/4
它正在寻找 Microsoft Visual Studio 编译器来处理一些(可能是)C 库。
您需要安装 Visual Studio,或者也许是 MINGW。
It is looking for the Microsoft Visual Studio compiler to take care of some (presumably) C libraries.
You need to install Visual Studio, or perhaps MINGW.