HiveBrain v1.2.0
Get Started
← Back to all entries
debugpythonCritical

pip install mysql-python fails with EnvironmentError: mysql_config not found

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
pythoninstallmysqlmysql_configpipnotfoundenvironmenterrorfailswith

Problem

This is the error I get

```
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "", line 14, in
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found

Traceback (most recent call last):

File "", line 14, in

File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 24, 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
Storing complete log in /home/zjm1126/.pip/pip.log
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "", line 14, in
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_co

Solution

It seems mysql_config is missing on your system or the installer could not find it.
Be sure mysql_config is really installed.

For example on Debian/Ubuntu you must install the package:

sudo apt-get install libmysqlclient-dev


Maybe the mysql_config is not in your path, it will be the case when you compile by yourself
the mysql suite.

Update: For recent versions of debian/ubuntu (as of 2018) it is

sudo apt install default-libmysqlclient-dev

Code Snippets

sudo apt-get install libmysqlclient-dev
sudo apt install default-libmysqlclient-dev

Context

Stack Overflow Q#5178292, score: 1610

Revisions (0)

No revisions yet.