Ubuntu: pip – mysql_config: not found

Автор: | 14/08/2014
 

ubuntu_logo_130При установке MySQLdb на Ubuntu – ошибка:

# pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_root/mysql-python/setup.py) egg_info for package mysql-python
sh: 1: mysql_config: not found
...
File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/mysql-python
Storing debug log for failure in /root/.pip/pip.log

Устанавливаем пакет:

# aptitude show libmysqlclient-dev
Package: libmysqlclient-dev
...
Description: MySQL database development files
MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MySQL are speed, robustness and ease of use.
# aptitude -y install libmysqlclient-dev

И ещё раззапускаем  pip:

# pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_root/mysql-python/setup.py) egg_info for package mysql-python
...

Successfully installed mysql-python
Cleaning up...