tags:

views:

44

answers:

2

I am trying to install MySQLdb for Python 2.6 as per these instructions:

http://www.tutorialspoint.com/python/python_database_access.htm

When I get to this step: $ python setup.py build I get the error:

users-MacBook-Pro:MySQL-python-1.2.3 user$ sudo python setup.py build sh: mysql_config: command not found Traceback (most recent call last): File "setup.py", line 15, in <module> metadata, options = get_config() File "/my_crawler/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/my_crawler/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found

I have MySQL installed and added to my bash

What am I doing wrong?

A: 

It's not looking for 'mysql', it's looking for 'mysql-config'. Try running 'which mysql-config' from bash. It probably won't be found. That's why the build isn't finding it either. Try running 'locate mysql-config' and see if anything comes back. The path to this binary needs to be either in your shell's $PATH environment variable, or it needs to be explicitly in the setup.py file for the module assuming it's looking in some specific place for that file.

If you installed mysql from source in /usr/local, I believe the file will be found at /usr/local/mysql/bin/mysql-config

jonesy
Thanks, for some reason my sym link didn't work originally.
ian
A: 

I am experiencing the same problem. I have already edited the path in the setup_posix.py file and haven't solved the issue. Does anybody know how to solve this ??

Thanks

Franklin
Did you make sure the link to `/usr/local` is symbolic?
ian