osx - Installing oursql on Mac OS Lion successes but import in python fails. **Why?** -
i followed installation instructions installing oursql on mac os x. since
sudo pip install oursql
told me, couldn't find mysql_config
(located locate mysql_config
and) told find by
sudo mysql_config=/usr/local/mysql-5.5.14-osx10.6-x86_64/bin/mysql_config pip install oursql
i added terminal output @ bottom readability reasons. after fired python in terminal (on mac os lion python 2.7 now,...) , did
>>> import oursql
but python keeps telling me:
>>> import oursql traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: dlopen(/library/python/2.7/site-packages/oursql.so, 2): library not loaded: libmysqlclient.18.dylib referenced from: /library/python/2.7/site-packages/oursql.so reason: image not found
what miss? suggestions?
terminal output, of pip installation:
downloading/unpacking oursql downloading oursql-0.9.2.tar.bz2 (113kb): 113kb downloaded running setup.py egg_info package oursql installing collected packages: oursql running setup.py install oursql skipping 'oursqlx/oursql.c' cython extension (up-to-date) building 'oursql' extension /usr/local/mysql-5.5.14-osx10.6-x86_64/bin/mysql_config --cflags llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -denable_dtrace -dmacosx -dndebug -wall -wstrict-prototypes -wshorten-64-to-32 -dndebug -g -fwrapv -os -wall -wstrict-prototypes -denable_dtrace -pipe -i/system/library/frameworks/python.framework/versions/2.7/include/python2.7 -c oursqlx/oursql.c -o build/temp.macosx-10.7-intel-2.7/oursqlx/oursql.o -i/usr/local/mysql-5.5.14-osx10.6-x86_64/include -os -g -fno-common -fno-strict-aliasing -arch x86_64 oursqlx/oursql.c: in function ‘__pyx_pf_6oursql_10connection___cinit__’: oursqlx/oursql.c:4630: warning: implicit conversion shortens 64-bit value 32-bit value oursqlx/oursql.c: in function ‘__pyx_pf_6oursql_10_statement_execute’: oursqlx/oursql.c:10219: warning: implicit conversion shortens 64-bit value 32-bit value oursqlx/oursql.c: in function ‘__pyx_pf_6oursql_16_dbapitypeobject___richcmp__’: oursqlx/oursql.c:17597: warning: implicit conversion shortens 64-bit value 32-bit value llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -denable_dtrace -dmacosx -dndebug -wall -wstrict-prototypes -wshorten-64-to-32 -dndebug -g -fwrapv -os -wall -wstrict-prototypes -denable_dtrace -pipe -i/system/library/frameworks/python.framework/versions/2.7/include/python2.7 -c oursqlx/compat.c -o build/temp.macosx-10.7-intel-2.7/oursqlx/compat.o -i/usr/local/mysql-5.5.14-osx10.6-x86_64/include -os -g -fno-common -fno-strict-aliasing -arch x86_64 /usr/local/mysql-5.5.14-osx10.6-x86_64/bin/mysql_config --libs llvm-gcc-4.2 -wl,-f. -bundle -undefined dynamic_lookup -wl,-f. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/oursqlx/oursql.o build/temp.macosx-10.7-intel-2.7/oursqlx/compat.o -o build/lib.macosx-10.7-intel-2.7/oursql.so -l/usr/local/mysql-5.5.14-osx10.6-x86_64/lib -lmysqlclient -lpthread ld: warning: ignoring file build/temp.macosx-10.7-intel-2.7/oursqlx/oursql.o, file built unsupported file format not architecture being linked (i386) ld: warning: ignoring file build/temp.macosx-10.7-intel-2.7/oursqlx/compat.o, file built unsupported file format not architecture being linked (i386) ld: warning: ignoring file /usr/local/mysql-5.5.14-osx10.6-x86_64/lib/libmysqlclient.dylib, file built unsupported file format not architecture being linked (i386) installed oursql cleaning up...
this did job:
export dyld_library_path="$dyld_library_path:/usr/local/mysql/lib/"
Comments
Post a Comment