Working in a AWS SageMaker notebook (Kernel PyTorch 1.8 Python 3.6 GPU optimized), I get errors when installing mysql and mysqlclient using commands:
!python3 -m pip install mysql
!python3 -m pip install mysqlclient
Both give about the same error message:
Collecting mysql
Using cached mysql-0.0.3-py3-none-any.whl (1.2 kB)
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-rhc6np1s
cwd: /tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/
Complete output (15 lines):
mysql_config --version
/bin/sh: 1: mysql_config: not found
mariadb_config --version
/bin/sh: 1: mariadb_config: not found
mysql_config --libs
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-uhwwzugv/mysqlclient_3db23749deac4d49af5f203f20638373/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
I've tried previously installing mysql using a wheel file but even though the install didn't spit any error I then got the message
ImportError: cannot import name '_mysql'
when creating an optuna study, so went back to reinstalling mysql.