[Fixed]-Django Error: vertualenv EnvironmentError: mysql_config not found

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

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)

Leave a comment