Tag : osx

Installing MYSQL-python on Mac OS X

I like to do my web development on my MacBook; I find it much easier than working on my Windows machine.  Sometimes things don’t go so well when installing things on my Mac, at least not as easy as they are when installing on Linux.  One of these such things is installing MYSQL-python into a virtual-env for use in my Django apps.  When I run it usually get something like this:


(thegame)strix:online_app cmoravec$ pip install mysql-python

File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found


The answer is actually pretty easy, before running pip (or permanently if you wanted) run:


export PATH=$PATH:/usr/local/mysql/bin


This assumes that your mysql is installed in /usr/local/mysql/bin.  I installed MySQL here to get the binaries and headers so that I could install things that depend on them, I actually use MAMP to run my database.  I understand that if you use the bitnami MAMP then you don’t have to go through this trouble, oh well, Live and Learn!

The most usefully link for information about this is from stackoverflow.