简体   繁体   English

EC2 实例中 Ubuntu 20.04 上的 MySQL 客户端安装错误

[英]MySQL Client installation error on Ubuntu 20.04 in EC2 instance

Using cached mysqlclient-2.0.3.tar.gz (88 kB)使用缓存mysqlclient-2.0.3.tar.gz (88 kB)

ERROR: Command errored out with exit status 1:
    command: /home/websiteuser/newenv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/setup.py'"'"';
 __file__='"'"'/tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/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-q2ahr_b3
        cwd: /tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/
Complete output (15 lines):
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/setup.py", line 15, in <module>
    metadata, options = get_config()
    File "/tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/setup_posix.py", line 70, in get_config
    libs = mysql_config("libs")
    File "/tmp/pip-install-gtzius4s/mysqlclient_581cfbeeeb974b418354ec534fb82b74/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). WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/ ) (需要-python:> = 3.5)。 Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整命令 output。 ERROR: Could not find a version that satisfies the requirement mysqlclient==2.0.3 ERROR: No matching distribution found for mysqlclient==2.0.3错误:找不到满足要求的版本 mysqlclient==2.0.3 错误:没有找到 mysqlclient==2.0.3 的匹配分发

I've fixed it using:我已经使用以下方法修复了它:

sudo apt-get install python3-dev default-libmysqlclient-dev build-essential

then:然后:

pip install mysqlclient

It was a compilation issue with Ubuntu.这是 Ubuntu 的编译问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM