Getting started with python on macintosh snow leopard with mysql - need help

dk dkelley21 at gmail.com
Sun Jul 11 16:18:39 EDT 2010


I have been going round and round trying to configure python 2.6
running on osx 10.6.x to work with mySQL 5.1.44.
Python seems to work ... i have an installation of mysql 5.1.44
running and have used it in conjunction for other php/apache projects.

I want to learn python and think i need a better database then mysql
lite that installs with the web2py frame work, so my quest to connect
to mysql or postgres began.

I seem to be stuck stuck getting mySQLdb drivers installed.  I down
loaded python 2.6.5 from the python site and MySQL-python-1.2.3 from
the my sql site.
I have worked past numerous errors by i now get the errors below when
i try to compile.

-- some background that might help anyone kind enough to have read
this far and who might be inclined to take pitty --
I have (tried) to use macports to install setuptools (which MySQL-
python-1.2.3 says it needs).
MacPorts has put tons of stuff in /opt/local ... so i am not sure i am
using this tool the way its intended.
this could all be as simple as adding some path declarations in the
right place but where?

lots of the post i have seen on the subject talk about 32/64
installation ... it makes sense that you might need to be consistent
in getting your components to work together, but i am not sure how i
tell of the various parts i have install which and how they were
compiled.

whereis python  display  /usr/bin/python
python -v spits out lots ... but here is a sample:

# /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
encodings/utf_8.pyc matches /Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/encodings/utf_8.py
import encodings.utf_8 # precompiled from /Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/encodings/utf_8.pyc
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin





when i try to compile mysql-python-1.2.3 i get the following error
returned from python setup.py build -----

building '_mysql' extension
gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing
-fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -
D__version__=1.2.3 -I/usr/local/mysql/include -I/Library/Frameworks/
Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/
temp.macosx-10.3-fat-2.6/_mysql.o -g -Os -arch x86_64 -fno-common -
D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -
DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
In file included from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/unicodeobject.h:4,
                 from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/Python.h:85,
                 from pymemcompat.h:10,
                 from _mysql.c:29:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:
stdarg.h: No such file or directory
In file included from _mysql.c:36:
/usr/local/mysql/include/my_config.h:1053:1: warning: "HAVE_WCSCOLL"
redefined
In file included from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/Python.h:8,
                 from pymemcompat.h:10,
                 from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/
pyconfig.h:808:1: warning: this is the location of the previous
definition
error: command 'gcc-4.0' failed with exit status 1



More information about the Python-list mailing list