【问题标题】:How to install MySQL-python on Amazon Web Services EC2 instance?如何在 Amazon Web Services EC2 实例上安装 MySQL-python?
【发布时间】:2019-06-22 00:20:37
【问题描述】:

我在 AWS 上创建了一个 EC2 实例并使用 PuTTY 连接到它。
我无法使用 python pip 命令安装 MySQL-python,如下所示:
pip install 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 安装其他软件包
请指导。

【问题讨论】:

标签: python mysql amazon-web-services amazon-ec2 setup.py


【解决方案1】:

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

sudo yum install -y mysql-devel

【讨论】:

    【解决方案2】:

    好像缺少mysql_config,所以请确认mysql_config真的安装好了。

    例如在 Debian/Ubuntu 上,您必须安装该软件包:

    sudo apt-get install libmysqlclient-dev
    

    【讨论】:

      猜你喜欢
      • 2014-12-25
      • 2016-08-31
      • 1970-01-01
      • 2015-04-04
      • 1970-01-01
      • 1970-01-01
      • 2017-09-22
      • 2017-10-25
      • 1970-01-01
      相关资源
      最近更新 更多