如何在Amazon Web Services EC2实例上安装MySQL-python?

Tor*_*ame 3 python mysql amazon-ec2 amazon-web-services setup.py

我在AWS上创建了一个EC2实例,并使用PuTTY连接到它.
我无法安装的MySQL蟒使用python PIP命令如下:
PIP安装MySQL-蟒(通过根特权)

以下是错误的控制台输出

Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-JGbAEI/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-JGbAEI/MySQL-python/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-JGbAEI/MySQL-python/setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-JGbAEI/MySQL-python
Run Code Online (Sandbox Code Playgroud)


但是,我可以使用pip
Please Guide 安装其他软件包.

小智 9

mysql_config 在Amazon Linux上安装以下软件包后可用:

sudo yum install -y mysql-devel
Run Code Online (Sandbox Code Playgroud)