MySQLdb for Python - incompatible library version error?

I, like many others, try to run MySQLdb for Python to run on Mac Snow Leopard (10.6.x), and I was able to install 64-bit MySQL DMG, as recommended by various blog posts / forums, and I was able to install setuptools and MySQLDB yourself using

ARCHFLAGS='-arch 86_64' python2.7 setup.py clean
ARCHFLAGS='-arch 86_64' python2.7 setup.py build
sudo ARCHFLAGS='-arch 86_64' python2.7 setup.py install

As you can see from the above, I upgraded to Python 2.7 and everything seems to be fine; unless I try to import MySQLdb into a python shell.

>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/ad/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib
  Referenced from: /Users/ad/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
  Reason: Incompatible library version: _mysql.so requires version 17.0.0 or later, but libmysqlclient.16.dylib provides version 16.0.0

I did a search and found libmysqlclient.16.dylib but not libmysqlclient.17.dylib

What causes this problem is how to solve it, and even though I performed a search for libmysqlclient.17.dylib, there seems to be nothing in it; he exists?

thank

+3
source
2

MySQL 5.5.x, 5.1.x. , .

0

, Python MySQL . 32-, 64- . , MySQLdb MySQL , , .

0

Source: https://habr.com/ru/post/1791935/


All Articles