PythonPython

"Error loading MySQLdb module Reason: image not found" error fix in El Capitan Mac OS

Oct 07, 2016 · Updated: Nov 10, 2017 · by Tim Kamanin

If you use mysql database in your Django project and when you run
runserver command and get an error message similar to this: " Error
loading MySQLdb module Reason: image not found"
that means your El Capitan
struggles to find necessary libraries.

The issue can be fixed with these two symlinks, just run following commands in
your terminal and you're set:

bash
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

Hey, if you've found this useful, please share the post to help other folks find it:

There's even more:

Subscribe for updates

  • via Twitter: @timonweb
  • old school RSS:
  • or evergreen email ↓ ↓ ↓