Skip to content

Instantly share code, notes, and snippets.

@nghiaht
Last active October 30, 2018 04:51
Show Gist options
  • Save nghiaht/0521f4da11ddcd4e0357999076aeb380 to your computer and use it in GitHub Desktop.
Save nghiaht/0521f4da11ddcd4e0357999076aeb380 to your computer and use it in GitHub Desktop.
Setup steps for python mysqlclient
cd ~
mkdir virtualenvs
cd virtualenvs
pip install virtualenv
virtualenv default # or virtualenv -p python3 default (depends on environments)
sudo apt-get install -y python-dev # or python3-dev
sudo apt-get install -y libmysqlclient-dev
source default/bin/activate
pip install mysqlclient
# https://stackoverflow.com/questions/33315210/error-command-x86-64-linux-gnu-gcc-when-installing-mysqlclient/33315233
# https://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment