5

I "successfully" installed MySQLdb using:

pip install mysql-python

But when I use the terminal to check, "import MySQLdb" throws this error:

Traceback (most recent call last): File "", line 1, in File "//anaconda/lib/python2.7/site-packages/MySQLdb/init.py", line 19, in import _mysql ImportError: dlopen(//anaconda/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libssl.1.0.0.dylib Referenced from: //anaconda/lib/python2.7/site-packages/_mysql.so Reason: image not found

I'm assuming this is due to some issue with linking, but I don't know what to do.

--- I'm on a Mac. ---

AllieCat
  • 3,890
  • 10
  • 31
  • 45
  • seems like you don't have libmysqlclient-dev installed, take a look here http://mysql-python.blogspot.in/2012/11/is-mysqldb-hard-to-install.html – Peeyush Aug 06 '14 at 15:55
  • I've installed mysql using homebrew. That worked just fine. – AllieCat Aug 06 '14 at 17:59

1 Answers1

0

MYsql-python is a wrapper around MySQL client libraries. Here, you seem to lack SSL libraries. Try installing libssl (if you're on a Debian/Ubuntu/Mint)

sudo apt-get install libssl1.0.0

Steve K
  • 10,879
  • 4
  • 39
  • 39
  • I'm on a mac. I'll add that to my question. – AllieCat Aug 06 '14 at 17:52
  • This got me on the right track. I was just missing a dependency. I implemented the answer here: http://stackoverflow.com/questions/11365619/psycopg2-installation-error-library-not-loaded-libssl-dylib The only difference was that I had 1.0.1h installed instead of 1.0.1c. – AllieCat Aug 07 '14 at 01:26
  • You should avoid 1.0.1c, as that version is vulnerable to the Heartbleed bug. – asmeurer Aug 14 '14 at 21:48