前提・実現したいこと
AmazonLightSailで建てた仮想マシンのCentOS7において、PythonのライブラリであるMySQLを使いたいので、
mysqlclientをインストールしようとしています。
しかし、「pip3.6 install mysqlclient」を実行しても以下のようなエラーが発生します。
発生している問題・エラーメッセージ
# sudo pip3.6 install mysqlclient WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Collecting mysqlclient Using cached mysqlclient-2.0.3.tar.gz (88 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/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-jjfnsxf4 cwd: /tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/ Complete output (15 lines): /bin/sh: mysql_config: コマンドが見つかりません /bin/sh: mariadb_config: コマンドが見つかりません /bin/sh: mysql_config: コマンドが見つかりません Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/setup.py", line 15, in <module> metadata, options = get_config() File "/tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/setup_posix.py", line 70, in get_config libs = mysql_config("libs") File "/tmp/pip-install-_qdfqjae/mysqlclient_b8ab4e5c2ebd476da4a1277aaceaafe2/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 ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. : : しばらくバージョン違い?のエラーメッセージが大量発生 : Using cached mysqlclient-1.3.0.tar.gz (76 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/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-q8nu7q8n cwd: /tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/ Complete output (10 lines): /bin/sh: mysql_config: コマンドが見つかりません Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/setup.py", line 17, in <module> metadata, options = get_config() File "/tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/setup_posix.py", line 47, in get_config libs = mysql_config("libs_r") File "/tmp/pip-install-zorio24u/mysqlclient_6f1a0c387b194d50ac7b190c6ef78355/setup_posix.py", line 29, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/6a/91/bdfe808fb5dc99a5f65833b370818161b77ef6d1e19b488e4c146ab615aa/mysqlclient-1.3.0.tar.gz#sha256=06eb5664e3738b283ea2262ee60ed83192e898f019cc7ff251f4d05a564ab3b7 (from https://pypi.org/simple/mysqlclient/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement mysqlclient (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3) ERROR: No matching distribution found for mysqlclient
試したこと
調べた限りだと、同じようなエラーに遭遇しているサイトや質問はありませんでした。
補足情報(FW/ツールのバージョンなど)
AmazonLightSail
CentOS7.9
Python3.6
pip
mysqld --version
mysqld Ver 5.6.25 for Linux on x86_64 (MySQL Community Server (GPL))
回答1件
あなたの回答
tips
プレビュー