mysql plugin not working on mac OS X 10.5.2 (Leopard)

4 views
Skip to first unread message

kavikaBldr

unread,
May 12, 2008, 4:28:20 PM5/12/08
to TurboGears
All,
I went through the install instructions and everything seemed to go
fine, but when I try to populate my DB, I get the stacktrace below.
(Note that I have created the referenced DB and verified that
the password works)
What is this about?

Thanks
------------------------------------------------------

the-dave:foo$ tg-admin sql create
Using database URI mysql://foo:foo_pw@localhost:3306/foo_dev
Traceback (most recent call last):
File "/usr/local/bin/tg-admin", line 8, in <module>
load_entry_point('TurboGears==1.0.4.4', 'console_scripts', 'tg-
admin')()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/turbogears/
command/base.py", line 369, in main
command.run()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/turbogears/
command/base.py", line 126, in run
command.the_runner.run(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
manager/command.py", line 101, in run
runner.run()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
manager/command.py", line 307, in run
self.command()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
manager/command.py", line 628, in command
for soClass in self.classes(require_some=True):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
manager/command.py", line 329, in classes
conn = self.connection()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
manager/command.py", line 390, in connection
return sqlobject.connectionForURI(self.options.connection_uri)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
dbconnection.py", line 928, in connectionForURI
conn = connCls.connectionFromURI(uri)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
mysql/mysqlconnection.py", line 56, in connectionFromURI
host=host or 'localhost', port=port or 0, **args)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLObject-0.10dev_r2692-py2.5.egg/sqlobject/
mysql/mysqlconnection.py", line 23, in __init__
import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER
File "build/bdist.macosx-10.3-fat/egg/MySQLdb/__init__.py", line 19,
in <module>
File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in
<module>
File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in
__bootstrap__
ImportError: dlopen(/Users/dvollmar/.python-eggs/MySQL_python-1.2.2-
py2.5-macosx-10.3-fat.egg-tmp/_mysql.so, 2): Library not loaded: /usr/
local/mysql/lib/mysql/libmysqlclient_r.15.dylib
Referenced from: /Users/dvollmar/.python-eggs/MySQL_python-1.2.2-
py2.5-macosx-10.3-fat.egg-tmp/_mysql.so
Reason: image not found

percious

unread,
May 12, 2008, 4:44:35 PM5/12/08
to TurboGears
how did you install mysql-python?

cheers.
-chris

kavikaBldr

unread,
May 12, 2008, 4:52:54 PM5/12/08
to TurboGears
Like this:
sudo easy_install MySQL_python

percious

unread,
May 12, 2008, 5:23:04 PM5/12/08
to TurboGears
I've had some problems on [Tiger] with easy_installed version of mysql-
python

my suggestion is to download it from:
http://sourceforge.net/projects/mysql-python

tar xvfz mysql-python.tar.gz

cd mysql-python
python setup.py install

Hope that works,
chris

kavikaBldr

unread,
May 12, 2008, 7:00:18 PM5/12/08
to TurboGears
Thanks, but the build still fails:
creating build/temp.macosx-10.3-i386-2.5
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -
Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/
usr/local/mysql-5.0.51b-osx10.5-x86_64/include -I/Library/Frameworks/
Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/
temp.macosx-10.3-i386-2.5/_mysql.o -Os -arch x86_64 -fno-common
In file included from /Library/Frameworks/Python.framework/Versions/
2.5/include/python2.5/Python.h:57,
from pymemcompat.h:10,
from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/
pyport.h:761:2: error: #error "LONG_BIT definition appears wrong for
platform (bad gcc/glibc config?)."
In file included from _mysql.c:35:
/usr/local/mysql-5.0.51b-osx10.5-x86_64/include/my_config.h:1032:1:
warning: "SIZEOF_LONG" redefined
In file included from /Library/Frameworks/Python.framework/Versions/
2.5/include/python2.5/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/
pyconfig.h:814:1: warning: this is the location of the previous
definition
error: command 'gcc' failed with exit status 1

percious

unread,
May 12, 2008, 7:04:40 PM5/12/08
to TurboGears
you need to install xcode, or get gcc on your machine in some other
way.

cheers.
-chris

Graham Dumpleton

unread,
May 12, 2008, 11:52:39 PM5/12/08
to TurboGears


On May 13, 9:00 am, kavikaBldr <kavika.voll...@gmail.com> wrote:
> Thanks, but the build still fails:
> creating build/temp.macosx-10.3-i386-2.5
> gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -
> Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
> DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/
> usr/local/mysql-5.0.51b-osx10.5-x86_64/include -I/Library/Frameworks/
> Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/
> temp.macosx-10.3-i386-2.5/_mysql.o -Os -arch x86_64 -fno-common
> In file included from /Library/Frameworks/Python.framework/Versions/
> 2.5/include/python2.5/Python.h:57,
>                  from pymemcompat.h:10,
>                  from _mysql.c:29:
> /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/
> pyport.h:761:2: error: #error "LONG_BIT definition appears wrong for
> platform (bad gcc/glibc config?)."
> In file included from _mysql.c:35:
> /usr/local/mysql-5.0.51b-osx10.5-x86_64/include/my_config.h:1032:1:
> warning: "SIZEOF_LONG" redefined

If you are on Leopard, don't use MacPorts Python/gcc which was
inherited from a Tiger upgrade. That or make sure you have installed
very latest MacPorts versions which are fully fat architecture
compatible, ie., both 32 and 64 bit variants of ppc and intel
architectures.

Better still get rid of your MacPorts Python/gcc and use Python/gcc
that comes with Leopard.

In short, you are using a version of Python/gcc that when produced
wasn't configured/built for use on a 64 bit architecture, but only 32
bit architecture. This results in the error:

error: #error "LONG_BIT definition appears wrong for platform (bad
gcc/glibc config?)."

Ie., Python installed header files don't have required definition for
64 bit, amongst other things.

See section 'Non Universal Developer Tools' of:

http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX

as it talks a bit about it.

Graham

kavikaBldr

unread,
May 13, 2008, 3:30:15 PM5/13/08
to TurboGears
OK, I don't really know why this fixed the issue, but now I am up and
running.
Here are the steps I took:
1) Downloaded and re-installed the latest version of X code
2) sudo mkdir /usr/local/mysql/lib/mysql/
3) sudo ln -s /usr/local/mysql/lib/libmysqlclient_r.15.dylib /usr/
local/mysql/lib/mysql/

Note that I am using know the 32 bit version of mysql.

All, thanks for all the input!


Reply all
Reply to author
Forward
0 new messages