Django Python 3 Error in MySQL Module Installation
Error:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?
ModuleNotFoundError: No module named ‘ConfigParser’
Resolution:
I tried to install mysql module using pip command but it failed several times. pip install mysqlclient
Here are the steps worked for me. Run each command one by one in terminal. Note I used pip3 instead on pip because of I have python2 and python3 both installed on my MacBook. If you have only installed python3 on your pc then run only pip command. Python 2 is by default installed on MacBooks.
- pip3 install mysql-connector
- pip3 install PyMySQL
- pip3 install mysql-client
- export PATH=”/usr/local/opt/openssl/bin:$PATH”
export LDFLAGS=”-L/usr/local/opt/openssl/lib”
export CPPFLAGS=”-I/usr/local/opt/openssl/include” - pip3 install mysqlclient
Recent Comments