Skip to content Skip to sidebar Skip to footer

Can't Load Mysqlclient.18.dylib Into Python On Mac OS Lion

I want to get MySQL working with the system Python 2.7 in Mac OS X Lion. I know there are a lot of questions very similar to this out there, and in fact my symptom is identical to

Solution 1:

Chances are you have set the default execution mode of the Apple-supplied Python to 32-bits, either by using defaults or by setting the VERSIONER_PYTHON_PREFER_32_BIT environment variable; see man python for details. In OS X 10.6 and 10.7 /usr/bin/python is an Apple-supplied wrapper program that determines which Python to run and in which mode. Using arch to execute /usr/bin/python will not influence the interpreter. For example:

$ unset VERSIONER_PYTHON_PREFER_32_BIT 
$ arch -x86_64 /usr/bin/python -c "import sys;print(sys.maxsize)"
9223372036854775807
$ export VERSIONER_PYTHON_PREFER_32_BIT=yes
$ arch -x86_64 /usr/bin/python -c "import sys;print(sys.maxsize)"
2147483647
#
# But avoiding the wrapper program ....
#
$ arch -x86_64 /usr/bin/python2.7 -c "import sys;print(sys.maxsize)"
9223372036854775807
$ arch -i386 /usr/bin/python2.7 -c "import sys;print(sys.maxsize)"
2147483647

Post a Comment for "Can't Load Mysqlclient.18.dylib Into Python On Mac OS Lion"