SORU
30 Aralık 2010, PERŞEMBE


Python: MySQLdb ve "Library yüklü değil: libmysqlclient.16.dylib"

Kur...

Temiz Mac os X 10.6 kurmak için çalışıyoruz python/django geliştirmek için yükleyin ve 10.5 bu içine çalışan hatırlayamadım.

mysql-5.5.8-osx10.6-x86_64.dmg yükleyici MySQL kurduktan sonra çalıştırdım

$ sudo pip install MySQL-python

ve sorunsuz (çıktısı) gitti

Downloading/unpacking MySQL-python
  Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
  Running setup.py egg_info for package MySQL-python
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'GPL'
Installing collected packages: MySQL-python
  Running setup.py install for MySQL-python
    building '_mysql' extension
    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.6-universal-2.6/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch x86_64
    In file included from _mysql.c:36:
    /usr/local/mysql/include/my_config.h:325:1: warning: "SIZEOF_SIZE_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:33:1: warning: this is the location of the previous definition
    In file included from _mysql.c:36:
    /usr/local/mysql/include/my_config.h:419:1: warning: "HAVE_WCSCOLL" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:8,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h:803:1: warning: this is the location of the previous definition
    gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup build/temp.macosx-10.6-universal-2.6/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lpthread -o build/lib.macosx-10.6-universal-2.6/_mysql.so -arch x86_64
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'GPL'
Successfully installed MySQL-python
Cleaning up...

bundan sonra çalıştım:

$ python -c "import MySQLdb"

ve benimle birlikte o da bozuldu:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Library/Python/2.6/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib
  Referenced from: /Library/Python/2.6/site-packages/_mysql.so
  Reason: image not found

Yani benim soru için

Ben ne yaptım/?Başka ne yapmam gerekiyor?

Python tho ile bu sonuçlar döndürüyor bir sürü Ruby ile bu hata mesajı çok fazla değil almak için Googling (burayı ararken).

CEVAP
3 Ocak 2011, PAZARTESİ


Sadece pip install easy_install çalıştırdıktan sonra DYLD_LIBRARY_PATH set:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

Bu işini görür MySQL kurulumu /usr/local/mysql altında yaşıyor varsayarsak.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ASUS Campus Life

    ASUS Campus

    18 Mart 2013
  • Bad Lip Reading

    Bad Lip Read

    22 Mart 2011
  • olinerd

    olinerd

    23 AĞUSTOS 2007