Monday, February 27, 2012

Re: What is the simplest way to install MySQL-python on Lion 10.7 with Xcode 4.3?

I think your problem might be solved in this SO post:

http://stackoverflow.com/questions/6383310/python-mysqldb-library-not-loade
d-libmysqlclient-18-dylib

By the way, I'd highly recommend using Homebrew instead of MacPorts and
pip/virtualenv instead of sudo easy_install.

Brett


On 2/27/12 2:01 PM, "Bryan" <bryan.wheelock@gmail.com> wrote:

>I am setting up Python and Django on os X 10.7 from a virgin install
>and Xcode 4.3.
>
>I tried using the default install of Python:
>/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
>
>$ sudo easy_install MySQL-python
>Searching for MySQL-python
>Reading http://pypi.python.org/simple/MySQL-python/
>Reading http://sourceforge.net/projects/mysql-python/
>Reading http://sourceforge.net/projects/mysql-python
>Best match: MySQL-python 1.2.3
>Downloading
>http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.
>3.tar.gz
>Processing MySQL-python-1.2.3.tar.gz
>Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/
>easy_install-da_8kh/MySQL-python-1.2.3/egg-dist-tmp-CA6FMW
>warning: no files found matching 'MANIFEST'
>warning: no files found matching 'ChangeLog'
>warning: no files found matching 'GPL'
>In file included from _mysql.c:36:
>/usr/local/mysql/include/my_config.h:329:1: warning: "SIZEOF_SIZE_T"
>redefined
>In file included from /System/Library/Frameworks/Python.framework/
>Versions/2.7/include/python2.7/Python.h:9,
> from pymemcompat.h:10,
> from _mysql.c:29:
>/System/Library/Frameworks/Python.framework/Versions/2.7/include/
>python2.7/pymacconfig.h:43:1: warning: this is the location of the
>previous definition
>In file included from _mysql.c:36:
>/usr/local/mysql/include/my_config.h:422:1: warning: "HAVE_WCSCOLL"
>redefined
>In file included from /System/Library/Frameworks/Python.framework/
>Versions/2.7/include/python2.7/Python.h:8,
> from pymemcompat.h:10,
> from _mysql.c:29:
>/System/Library/Frameworks/Python.framework/Versions/2.7/include/
>python2.7/pyconfig.h:891:1: warning: this is the location of the
>previous definition
>_mysql.c: In function Œ_mysql_server_init¹:
>_mysql.c:253: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:278: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_ResultObject_Initialize¹:
>_mysql.c:405: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_escape_string¹:
>_mysql.c:986: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:988: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_string_literal¹:
>_mysql.c:1016: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:1025: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:1027: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_escape_sequence¹:
>_mysql.c:1111: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_row_to_dict¹:
>_mysql.c:1298: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:1300: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c: In function Œ_mysql_row_to_dict_old¹:
>_mysql.c:1336: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>_mysql.c:1338: warning: implicit conversion shortens 64-bit value into
>a 32-bit value
>zip_safe flag not set; analyzing archive contents...
>Adding MySQL-python 1.2.3 to easy-install.pth file
>
>Installed /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg
>Processing dependencies for MySQL-python
>Finished processing dependencies for MySQL-python
>#############################################################
>
>When I tried to run the server, I got the following Traceback:
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.7-intel.egg-tmp/_mysql.so
> Reason: image not found
>
>What is causing these errors?
>
>
>I also tried to install MySQL-python via mac ports.
>
>$ sudo port install py27-mysql
>Warning: xcodebuild exists but failed to execute
>Warning: Xcode does not appear to be installed; most ports will likely
>fail to build.
>---> Computing dependencies for py27-mysql
>---> Dependencies to be installed: mysql5 openssl zlib readline
>ncurses ncursesw py27-distribute python27 bzip2 db46 gettext expat
>libiconv gperf libedit python_select sqlite3
>---> Extracting zlib
>Error: Couldn't determine your Xcode version (from '/usr/bin/
>xcodebuild -version').
>Error:
>Error: If you have not installed Xcode, install it now; see:
>Error: http://guide.macports.org/chunked/installing.xcode.html
>Error:
>Error: Target org.macports.extract returned: unable to find Xcode
>Error: Failed to install zlib
>Log for zlib is at: /opt/local/var/macports/logs/
>_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_
>archivers_zlib/
>zlib/main.log
>Error: The following dependencies were not installed: mysql5 openssl
>zlib readline ncurses ncursesw py27-distribute python27 bzip2 db46
>gettext expat libiconv gperf libedit python_select sqlite3
>Error: Status 1 encountered during processing.
>To report a bug, see <http://guide.macports.org/#project.tickets>
>
>
>Finally, I attempted to build the projects from source, but I'm still
>seeing the same errors.
>Bryan@Bryans-MacBook-Pro Mon Feb 27 14:24:50 ~/Downloads/MySQL-
>python-1.2.3
>$ python setup.py build
>running build
>running build_py
>copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
>running build_ext
>Bryan@Bryans-MacBook-Pro Mon Feb 27 14:25:21 ~/Downloads/MySQL-
>python-1.2.3
>$ sudo python setup.py install
>Password:
>running install
>running bdist_egg
>running egg_info
>writing MySQL_python.egg-info/PKG-INFO
>writing top-level names to MySQL_python.egg-info/top_level.txt
>writing dependency_links to MySQL_python.egg-info/dependency_links.txt
>reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
>reading manifest template 'MANIFEST.in'
>warning: no files found matching 'MANIFEST'
>warning: no files found matching 'ChangeLog'
>warning: no files found matching 'GPL'
>writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
>installing library code to build/bdist.macosx-10.6-intel/egg
>running install_lib
>running build_py
>copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
>running build_ext
>creating build/bdist.macosx-10.6-intel/egg
>copying build/lib.macosx-10.6-intel-2.7/_mysql.so -> build/
>bdist.macosx-10.6-intel/egg
>copying build/lib.macosx-10.6-intel-2.7/_mysql_exceptions.py -> build/
>bdist.macosx-10.6-intel/egg
>creating build/bdist.macosx-10.6-intel/egg/MySQLdb
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/__init__.py -> build/
>bdist.macosx-10.6-intel/egg/MySQLdb
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/connections.py ->
>build/bdist.macosx-10.6-intel/egg/MySQLdb
>creating build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/__init__.py -
>> build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/CLIENT.py ->
>build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/CR.py ->
>build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/ER.py ->
>build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/
>FIELD_TYPE.py -> build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/FLAG.py ->
>build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/constants/REFRESH.py -
>> build/bdist.macosx-10.6-intel/egg/MySQLdb/constants
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/converters.py -> build/
>bdist.macosx-10.6-intel/egg/MySQLdb
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/cursors.py -> build/
>bdist.macosx-10.6-intel/egg/MySQLdb
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/release.py -> build/
>bdist.macosx-10.6-intel/egg/MySQLdb
>copying build/lib.macosx-10.6-intel-2.7/MySQLdb/times.py -> build/
>bdist.macosx-10.6-intel/egg/MySQLdb
>byte-compiling build/bdist.macosx-10.6-intel/egg/_mysql_exceptions.py
>to _mysql_exceptions.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py
>to __init__.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/
>connections.py to connections.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>__init__.py to __init__.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>CLIENT.py to CLIENT.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>CR.py to CR.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>ER.py to ER.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>FIELD_TYPE.py to FIELD_TYPE.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>FLAG.py to FLAG.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/constants/
>REFRESH.py to REFRESH.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/converters.py
>to converters.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/cursors.py to
>cursors.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/release.py to
>release.pyc
>byte-compiling build/bdist.macosx-10.6-intel/egg/MySQLdb/times.py to
>times.pyc
>creating stub loader for _mysql.so
>byte-compiling build/bdist.macosx-10.6-intel/egg/_mysql.py to
>_mysql.pyc
>creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
>copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.6-
>intel/egg/EGG-INFO
>copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-
>intel/egg/EGG-INFO
>copying MySQL_python.egg-info/dependency_links.txt -> build/
>bdist.macosx-10.6-intel/egg/EGG-INFO
>copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.6-
>intel/egg/EGG-INFO
>writing build/bdist.macosx-10.6-intel/egg/EGG-INFO/native_libs.txt
>zip_safe flag not set; analyzing archive contents...
>creating 'dist/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg' and
>adding 'build/bdist.macosx-10.6-intel/egg' to it
>removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
>Processing MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg
>Copying MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg to /Library/
>Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>Adding MySQL-python 1.2.3 to easy-install.pth file
>
>Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/
>python2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg
>Processing dependencies for MySQL-python==1.2.3
>Finished processing dependencies for MySQL-python==1.2.3
>Bryan@Bryans-MacBook-Pro Mon Feb 27 14:26:01 ~/Downloads/MySQL-
>python-1.2.3
>$ rs
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so
> Reason: image not found
>Traceback (most recent call last):
> File "/Users/Bryan/work/osqa/forum_modules/mysqlfulltext/
>__init__.py", line 8, in <module>
> import MySQLdb
> File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line
>19, in <module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in
><module>
> File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in
>__bootstrap__
>ImportError: dlopen(/Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded:
>libmysqlclient.18.dylib
> Referenced from: /Users/Bryan/.python-eggs/MySQL_python-1.2.3-py2.7-
>macosx-10.6-intel.egg-tmp/_mysql.so
> Reason: image not found
>Validating models...
>
>0 errors found
>Django version 1.3.1, using settings 'osqa.settings'
>Development server is running at http://127.0.0.1:8000/
>Quit the server with CONTROL-C.
>
>--
>You received this message because you are subscribed to the Google Groups
>"Django users" group.
>To post to this group, send email to django-users@googlegroups.com.
>To unsubscribe from this group, send email to
>django-users+unsubscribe@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment