Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Error: vertualenv EnvironmentError: mysql_config not found [duplicate]

Tags:

django

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
like image 300
Glyn Jackson Avatar asked Mar 09 '13 19:03

Glyn Jackson


2 Answers

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

like image 73
Glyn Jackson Avatar answered Sep 24 '22 22:09

Glyn Jackson


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)
like image 31
Ellochka Cannibal Avatar answered Sep 21 '22 22:09

Ellochka Cannibal