Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install MySQL-python on Amazon Web Services EC2 instance?

I have a EC2 instance created on AWS and use PuTTY to connect to it.
I'm unable to install MySQL-python using python pip command as follows:
pip install MySQL-python(via root privileges)

Here is the console output of the error

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


However I'm able to install other packages using pip
Please Guide.

like image 976
Tore Binarflame Avatar asked Jun 13 '16 08:06

Tore Binarflame


1 Answers

mysql_config is available after installation of the following package on Amazon Linux:

sudo yum install -y mysql-devel
like image 63
aloschilov Avatar answered Oct 21 '22 08:10

aloschilov