Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?'



PHP Snippet 1:

pip install pymysql

PHP Snippet 2:

import pymysql

pymysql.install_as_MySQLdb()

PHP Snippet 3:

# on macOS, on or about line 112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "

PHP Snippet 4:

# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"

PHP Snippet 5:

pip install pymysql

PHP Snippet 6:

python3 -m pip install PyMySQL

PHP Snippet 7:

import pymysql

pymysql.install_as_MySQLdb()

PHP Snippet 8:

pip install mysql-python
apt-get install python3-mysqldb libmysqlclient-dev python-dev

PHP Snippet 9:

export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

PHP Snippet 10:

import pymysql

pymysql.install_as_MySQLdb()

PHP Snippet 11:

conda install -c bioconda mysqlclient

PHP Snippet 12:

pip install pymysql

PHP Snippet 13:

try:
    import MySQLdb as Database
except ImportError as err:
    raise ImproperlyConfigured(
        'Error loading MySQLdb module.\n'
        'Did you install mysqlclient?'
    ) from err

PHP Snippet 14:

MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

PHP Snippet 15:

python -m pip install "C:\Users\Abhijit\Downloads\mysqlclient-1.4.6-cp36-cp36m-win_amd64.whl"

PHP Snippet 16:

brew install protobuf

PHP Snippet 17:

export LDFLAGS="${LDFLAGS} -L/usr/local/opt/protobuf/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/protobuf/include"

PHP Snippet 18:

pip uninstall mysqlclient
pip install mysqlclient

PHP Snippet 19:

user@cl1-preprod ~ % mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 39

PHP Snippet 20:

user@cl1-preprod ~ % apt-get remove libmysqlclient-dev python-dev
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Le paquet « libmysqlclient-dev » n'est pas installé, et ne peut donc être supprimé
Le paquet « python-dev » n'est pas installé, et ne peut donc être supprimé