I've just received my new Intel MacBook and have been trying to install MySQLdb 1.2.1fc7. There are a few issues which means that it doesn't work 'out of the box'; not bugs in MySQLdb, but things that might be worth mentioning in the build notes.
(1) MySQL path
The MySQL 4.1 installer (and possibly later ones) doesn't add MySQL to your PATH. This means that the MySQLdb build can't find mysql_config, and you will get compilation errors.
The best solution to this is to add mysql to your PATH:
export PATH=${PATH}:/usr/local/mysql/bin
(2) ActivePython issues
MySQLdb works fine with the default Python install provided by Apple (2.3.5), but it doesn't work with the ActivePython Intel install (2.4.2). Attempting to use it gives the following error:
Traceback (most recent call last):
File "citationanalyzer.py", line 12, in ?
import MySQLdb
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/MySQLdb/init.py", line 19, in ?
import _mysql
ImportError: Failure linking new module: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so: Symbol not found: _mysql_get_host_info
Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so
Expected in: dynamic lookup
I haven't dug into this too deeply yet, but I believe it might have something to do with a mismatch in the way in which ActivePython and _mysql.so are being built.
My solution for the moment is to go back to Apple's version of Python, but I'll keep looking for a better solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The second error has gone away, so I can report that MySQLdb works with ActivePython 2.4 on Mac OS X (Intel). I am not sure what conspired to give the error the first time, but I'm guessing that it was a some combination of not having the PATH set correctly (so that the MySQLdb build script can find both the correct version of Python and MySQL).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just received my new Intel MacBook and have been trying to install MySQLdb 1.2.1fc7. There are a few issues which means that it doesn't work 'out of the box'; not bugs in MySQLdb, but things that might be worth mentioning in the build notes.
(1) MySQL path
The MySQL 4.1 installer (and possibly later ones) doesn't add MySQL to your PATH. This means that the MySQLdb build can't find mysql_config, and you will get compilation errors.
The best solution to this is to add mysql to your PATH:
export PATH=${PATH}:/usr/local/mysql/bin
(2) ActivePython issues
MySQLdb works fine with the default Python install provided by Apple (2.3.5), but it doesn't work with the ActivePython Intel install (2.4.2). Attempting to use it gives the following error:
Traceback (most recent call last):
File "citationanalyzer.py", line 12, in ?
import MySQLdb
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/MySQLdb/init.py", line 19, in ?
import _mysql
ImportError: Failure linking new module: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so: Symbol not found: _mysql_get_host_info
Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so
Expected in: dynamic lookup
I haven't dug into this too deeply yet, but I believe it might have something to do with a mismatch in the way in which ActivePython and _mysql.so are being built.
My solution for the moment is to go back to Apple's version of Python, but I'll keep looking for a better solution.
Replying to my own message here...
The second error has gone away, so I can report that MySQLdb works with ActivePython 2.4 on Mac OS X (Intel). I am not sure what conspired to give the error the first time, but I'm guessing that it was a some combination of not having the PATH set correctly (so that the MySQLdb build script can find both the correct version of Python and MySQL).