PyMySQL / mysqlclient

MySQL database connector for Python (with Python 3 support)

Home Page:https://mysqlclient.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to pip install mysqlclient on RHEL8 with Python 3.9.13

sri1981-16 opened this issue · comments

Describe the bug

Unable to pip install mysqlclient on RHEL8 with Python 3.9.13

A clear and concise description of what the bug is.

To Reproduce

sudo yum install python3-devel mysql-devel
pip3 install mysqlclient

Environment

  • OS

cat /etc/redhat-release
Red Hat Enterprise Linux release 8.7 (Ootpa)

  • Python

python3 -V
Python 3.9.13

pip3 -V
pip 20.2.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)

Error details

Collecting mysql-connector>=2.2
Using cached mysql-connector-2.2.9.tar.gz (11.9 MB)
Collecting mysqlclient>=2
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: /apps/opt/forecasting/forecasting/cloudfinops/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-06s43suw/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-06s43suw/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-28551i7t
cwd: /tmp/pip-install-06s43suw/mysqlclient/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-06s43suw/mysqlclient/setup.py", line 15, in
metadata, options = get_config()
File "/tmp/pip-install-06s43suw/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-06s43suw/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs


ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.4; however, version 22.3.1 is available.