I'm trying to build MySQL-python-1.2.2 on Mac OS 10.4.9 with Python 2.4.3. I have gcc 4.0.1. My MySQL is the current download from mysql.com:
mysql Ver 14.12 Distrib 5.0.41, for apple-darwin8.5.1 (i686) using readline 5.0
When I type:
MySQL-python-1.2.2 % python setup.py build
I get (lot of output that looks fine, and then:)
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.4-fat-2.4/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/lib.macosx-10.4-fat-2.4/_mysql.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning /usr/local/mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
This kind of makes sense -- that is the correct installed location for MySQL, and the packages from MySQL.com are single-architecture, but MySQL-python is trying to build a fat binary. However, I don't know enough about setup.py to know how to convince it not to build a fat binary on Mac OS X --- anybody know that spell, or another workaround for this problem?
TiA,
Leo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not an expert on this myself, but I had a similar error. Does the build process totally fail or is that the end of the output? In my case, I went ahead with "sudo python setup.py install". Everything worked with the only exception of needing a secondary mysql directry under lib for some reason.
J
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even I am having same issue "of looking into different folder" for me. I installed MySQL 5.1 from mysql.org and the lib files are at: /usr/loca/mysql/lib but for some reason the module looks at: /usr/local/mysql/mysql/lib/mysql. Making a symlink solved the issue but I think its a bad hack
Is this an error with the package?
-- Ritesh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, after creating the symlink, when I do: import MySQLdb, I get this warning:
>>> import MySQLdb
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.pyc, but /Users/acidity/Documents/Downloads/MySQL-python-1.2.2 is being added to sys.path
import sys, pkg_resources, imp
-- Ritesh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the exact same problem and the build process totally failed. "sudo python setup.py install" did not work, I got the same error message as above...any thoughts or suggestions?
kcs
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having the exact same problem as Leo:
- OS 10.4.9 on a PBG4
- Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
- GCC 4.0.1 (Apple Computer, Inc. build 5367) on darwin
- MySQL 5.0.41 installed in /usr/local/mysql
- MySQL-python-1.2.2
When I try to build MySQL-python I get this:
python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/_mysql.o /usr/local/mysql/lib/libmysqld.a -L/usr/local/mysql/lib -lmysqld -lz -lm -o build/lib.macosx-10.3-fat-2.5/_mysql.so
i686-apple-darwin8-gcc-4.0.1: /usr/local/mysql/lib/libmysqld.a: No such file or directory
powerpc-apple-darwin8-gcc-4.0.1: /usr/local/mysql/lib/libmysqld.a: No such file or directory
lipo: can't figure out the architecture type of: /var/tmp//cc82FyjP.out
error: command 'gcc' failed with exit status 1
Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to build MySQL-python-1.2.2 on Mac OS 10.4.9 with Python 2.4.3. I have gcc 4.0.1. My MySQL is the current download from mysql.com:
mysql Ver 14.12 Distrib 5.0.41, for apple-darwin8.5.1 (i686) using readline 5.0
When I type:
MySQL-python-1.2.2 % python setup.py build
I get (lot of output that looks fine, and then:)
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.4-fat-2.4/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/lib.macosx-10.4-fat-2.4/_mysql.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning /usr/local/mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
This kind of makes sense -- that is the correct installed location for MySQL, and the packages from MySQL.com are single-architecture, but MySQL-python is trying to build a fat binary. However, I don't know enough about setup.py to know how to convince it not to build a fat binary on Mac OS X --- anybody know that spell, or another workaround for this problem?
TiA,
Leo
Hi Leo.
Not an expert on this myself, but I had a similar error. Does the build process totally fail or is that the end of the output? In my case, I went ahead with "sudo python setup.py install". Everything worked with the only exception of needing a secondary mysql directry under lib for some reason.
Hello J
Even I am having same issue "of looking into different folder" for me. I installed MySQL 5.1 from mysql.org and the lib files are at: /usr/loca/mysql/lib but for some reason the module looks at: /usr/local/mysql/mysql/lib/mysql. Making a symlink solved the issue but I think its a bad hack
Is this an error with the package?
-- Ritesh
Yup, like several people mentioned I eventually solved this problem by doing two things:
static = True
in site.cfg (and the rebuilt and reinstall)
to .
Seems pretty ugly but I can fetch data now...
Leo
Also, after creating the symlink, when I do: import MySQLdb, I get this warning:
>>> import MySQLdb
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg/_mysql.pyc, but /Users/acidity/Documents/Downloads/MySQL-python-1.2.2 is being added to sys.path
import sys, pkg_resources, imp
-- Ritesh
I had the exact same problem and the build process totally failed. "sudo python setup.py install" did not work, I got the same error message as above...any thoughts or suggestions?
kcs
Hmmm. Not sure what to do next. I'm on Python 2.5.1, but I don't think that's the problem here. Other than that, I have the same config as Leo.
Have either of you tried linking to the static library by changing the site.cfg? Also, is there anything strange about the location of MySQL?
I'm having the exact same problem as Leo:
- OS 10.4.9 on a PBG4
- Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
- GCC 4.0.1 (Apple Computer, Inc. build 5367) on darwin
- MySQL 5.0.41 installed in /usr/local/mysql
- MySQL-python-1.2.2
When I try to build MySQL-python I get this:
python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/_mysql.o /usr/local/mysql/lib/libmysqld.a -L/usr/local/mysql/lib -lmysqld -lz -lm -o build/lib.macosx-10.3-fat-2.5/_mysql.so
i686-apple-darwin8-gcc-4.0.1: /usr/local/mysql/lib/libmysqld.a: No such file or directory
powerpc-apple-darwin8-gcc-4.0.1: /usr/local/mysql/lib/libmysqld.a: No such file or directory
lipo: can't figure out the architecture type of: /var/tmp//cc82FyjP.out
error: command 'gcc' failed with exit status 1
Any ideas?