I am trying to get a Python script to run on the linux server I'm connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to install mySQLdb via setuptools like so:,
python setup.py install
I get the following error report related to the mysql_config
command.
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Has anyone else encountered this error and if so how did you resolve it/what can I do to successfully install mysqldb?
On Red Hat I had to do
Then it worked.
I had the same problem. I solved it by following this tutorial to install Python with python3-dev on Ubuntu 16.04:
And now you can set up your virtual environment:
I got the same error while trying to install
mysql-python
.This is how I fixed it.
The problem was that the installer could not find the mysql_config in the default path. Now it can ..and it worked..
Hope this helps.
Thanks.
You need to install the python-dev package:
I was installing
python-mysql
on Ubuntu 12.04 usingFirst I had the same problem:
This worked for me
Then I had this problem:
Then I tried with
And then I was happy :)
I think, following lines can be executed on terminal
This mysql_config directory is for zend server on MacOSx. You can do it for linux like following lines
This is default linux mysql directory.