How to resolve the error pip install mysql-python fails with environmenterror: mysql_config not found?

150    Asked by Dhruvtiwari in SQL Server , Asked on Oct 16, 2023
 nd 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_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 What shall I do to solve this one?
Answered by Daniel Cameron

You are getting mysql_config not found on your system instantly. To eliminate this problem, ensure to have pip install MySQL on your system.

For instance, on Debian or Ubuntu, you must download the package:

Sudo apt-get install libmysqlclient-dev

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

For newer versions of Debian or Ubuntu, it is:

Sudo apt install default-libmysqlclient-dev



Your Answer

Interviews

Parent Categories