Pip install MySQL-Python
for installing MySQLdb
is not compatible with Python3.
import ConfigParser
From Python3, it is ↓ (all lowercase letters), so ModuleNotFoundError: No module named'ConfigParser'
causes an error.
import configparser
With pip install mysqlclient
.
Note that ↑ will fail if python-devel
is not included. ..
Python.h
in /usr/include/pythonX.X
.yum update -y
yum install -y python-devel # /usr/include/python2.7
yum install -y python3-devel # /usr/include/python3.7m
yum install -y python38-devel # /usr/include/python3.8
↓ is also recommended
yum install -y gcc mysql-devel mysql-libs # /lib64/mysql/libmysqlclient.so.18 enters
** When running on Lambda, be sure to see Running mysqlclient on Lambda
in the reference section **
Recommended Posts