数据库
首页 > 数据库> > 如何在Amazon Web Services EC2实例上安装MySQL-python?

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

作者:互联网

我在AWS上创建了一个EC2实例,并使用PuTTY连接到它.
我无法使用python pip命令安装MySQL-python,如下所示:

pip安装MySQL-python(通过root权限)

这是错误的控制台输出

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

但是我可以使用pip安装其他软件包

请指南.

解决方法:

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

sudo yum install -y mysql-devel

标签:setup-py,python,mysql,amazon-web-services,amazon-ec2
来源: https://codeday.me/bug/20190724/1525015.html