Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Took me a days to get mysqldb working on Snow Leopard so this time round I did a completely clean install of the operating system and carefully followed the various instructions on installation to try and get my django development environment working.

brew install mysql 
sudo pip intall django
sudo pip install python-mysql

ln -s sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
export PATH=/usr/local/mysql/bin:$PATH
sudo export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

Mysql and django working fine, but if I try to import MySQLdb or do a syncdb I get this error:

Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): Symbol not found: _mysql_affected_rows
  Referenced from: /Library/Python/2.7/site-packages/_mysql.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/_mysql.so
>>> 

Have been googling for a day now with no success and really need to get back to work! Any suggestions very welcome.

(also tried to install the mysql python-connector here http://dev.mysql.com/downloads/connector/python/ but there is no osx version and other instructions seem to imply you need the right version for your version of python no platform so I didn't pursue that further.)

share|improve this question
add comment (requires an account with 50 reputation)

This question has an open bounty worth +250 reputation from PhoebeB ending in 2 days.

This question has not received enough attention.

Help on this would be hugely appreciated!

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.