Zack
Zack

Reputation: 11

Python3 to MySQL connection on OSX ...ImportError: Reason: Image not found

I'm currently trying to have scrapy run code that scrapes a website and then writes the data to MySQL. I've been searching for hours on how to resolve my issue, but I get the following error when I run it:

File "/Users/USER/anaconda/lib/python3.5/site-packages/MySQLdb/init.py", line 19, in module import _mysql

ImportError: dlopen(/Users/USER/anaconda/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so, 2): Library not loaded: libssl.1.0.0.dylib

Referenced from: /Users/USER/anaconda/lib/python3.5/site-packages/_mysql.cpython-35m-darwin.so

Reason: image not found

Solutions attempted: uninstalling and reinstalling mysql, installing mysqlclient, installing mysql-connector-c, unlinking/relinking. Would greatly appreciate some help, as I've spent very little of my time actually coding and most of it simply trying to connect python with MySQL. Currently running Sierra 10.12.5.

Upvotes: 1

Views: 951

Answers (1)

Beomi
Beomi

Reputation: 1727

Try this:

brew install mysql

if this not works, how about using mysqlclient instead of PyMySql?

Upvotes: 1

Related Questions