13

I get the following error when I try to install MySQL-python within virtualenv on a MAC running 10.8.

vertualenv EnvironmentError: mysql_config not found
0

2 Answers 2

22

It's a simple fix just to edit the /bin/activate file from the virtualenv directory and add the following lines,

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
PATH="$PATH:/usr/local/mysql/bin/"
export PATH

That's it, just make sure you match your paths to your own configuration. Now MySQL-python installs under virtualenv as normal.

Link: http://glynjackson.org/weblog/entry/fix-vertualenv-environmenterror-mysql_config-not-found.html

Sign up to request clarification or add additional context in comments.

1 Comment

adding this line PATH="$PATH:/usr/local/mysql/bin/" has done the trick.
6

Also it can help you, especially if you use MacOS X

pip install MySQL-python (error)

echo "mysql_config = /usr/local/mysql/bin/mysql_config" >> ~/.virtualenvs/ENV_NAME/build/MySQL-python/site.cfg

pip install MySQL-python (it's ok)

1 Comment

This worked for me, though I am using MAMP and had to adjust the path to: /Applications/MAMP/Library/bin/mysql_config

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.