Skip to content Skip to sidebar Skip to footer

How To Install Flask-mysqldb On Mac Osx?

I tried sudo pip3 install flask-mysqldb but got the following error: Command 'python setup.py egg_info' failed with error code 1 in /private/tmp/pip-build-3l4jec4_/mysqlclient/

Solution 1:

The solution above works

conda install -c bioconda mysqlclient

Then run

pip install flask-mysqldb

Anaconda is a must have for python anyway.

Solution 2:

First set your mysql path by giving the command

export PATH=$PATH:/usr/local/mysql/bin

Then, use below to install flask-mysqldb,

pip3 install flask-mysqldb

then use library 'flask_mysqldb' in python.

Solution 3:

Just install it via pip install flask-mysqldb, it's python3 compatible.

Solution 4:

If you have anaconda installed, you can try the following:

  1. conda install -c bioconda mysqlclient

  2. pip install flask-mysqldb

This should work.

Solution 5:

After successfully install the flask-mysqldb, use it as:

from flaskext.mysqlimportMySQL

Post a Comment for "How To Install Flask-mysqldb On Mac Osx?"