2010-11-09 69 views
0

如果我嘗試使用shell,我會遇到這個API衝突。模塊_mysql的修復程序是什麼:這個Python的API版本是1012,模塊_mysql的版本是1013

/home/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-linux-i686.egg-tmp/_mysql.so:6: RuntimeWarning: Python C API version mismatch for module _mysql: This Python has API version 1012, module _mysql has version 1013. 

我運行:
的Python 2.6
MySQL服務器版本:5.0.77
MySQL_python-1.2.3c1

我曾嘗試更新到MySQL的Python的新版本。

的easy_install-2.6〜-d/lib中/ MySQL的python2.6的 - 蟒蛇

Searching for MySQL-python 
Best match: MySQL-python 1.2.3c1 
Processing MySQL_python-1.2.3c1-py2.6-linux-i686.egg 
MySQL-python 1.2.3c1 is already the active version in easy-install.pth 

Using /home/username/lib/python2.6/MySQL_python-1.2.3c1-py2.6-linux-i686.egg 
Processing dependencies for MySQL-python 
Finished processing dependencies for MySQL-python 

如何糾正這一錯誤?

回答

0

錯誤消息意味着_mysql模塊是MySQLdb的一部分,它是爲Python的新版本而構建的,而不是將其加載到。 API版本1013是Python 2.5和2.6使用的版本,1012是Python 2.4使用的版本。你不會說你使用MySQLdb的方式,但顯然它是由Python 2.4導入的。

+0

此錯誤是否危險?什麼是解決方案,該怎麼辦? – Danijel 2014-07-01 10:11:33