python MySQLdb ImportError: cannot import name conversions 解决办法

这被这个问题蛋疼许久,网上也找不到这方面的帖子,最后在 google 论坛看到了

https://groups.google.com/forum/#!topic/django-users/RkQXi8pcz6M

在天朝估计很多人打不开这个网址,下面说下解决办法!


>>> from MySQLdb.converters import conversions

The error you are seeing suggests that this is not the case.

The fact that you report your MySQLdb install as 'rev 635' suggests
that you're using a development version of MySQLdb. Either MySQLdb has
introduced a backwards incompatibility, or your build is incomplete or
contains errors.

To confirm this, I would suggest using a production version of MySQLdb
- recent production releases are known to work.

If it turns out that there has been a backwards incompatible
regression in MySQLdb, we will need to address that when a formal
release that contains that change is made.


就是安装了开发版的 MySQLdb 导致的,确实如此,我之前胡乱下的一个版本

看到此贴后,立即去官网下了最新正式版:
http://sourceforge.net/projects/mysql-python/?source=dlp

版再次安装,问题得以解决!


tar -xzf MySQL-python-1.2.4b4.tar.gz
cd MySQL-python-1.2.4b4
python setup.py build
python setup.py install



你可能感兴趣的:(python MySQLdb ImportError: cannot import name conversions 解决办法)