6
votes

Trying to install from pipenv with:

pipenv install mysqlclient

will reseult in:

Installing mysqlclient… Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz Complete output from command python setup.py egg_info: /bin/sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-5vhtqgve/mysqlclient/setup.py", line 17, in metadata, options = get_config() File "/tmp/pip-install-5vhtqgve/mysqlclient/setup_posix.py", line 44, in get_config libs = mysql_config("libs_r") File "/tmp/pip-install-5vhtqgve/mysqlclient/setup_posix.py", line 26, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found

----------------------------------------

Error: An error occurred while installing mysqlclient! Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-5vhtqgve/mysqlclient/

This is likely caused by a bug in mysqlclient. Report this to its maintainers.

I'm using a Debian and with another virtualenv it get the system package

python-mysqldb/testing,now 1.3.10-1 amd64 

Pipenv won't use this one and won't install the other. How can I solve this? Thanks,BR

6

6 Answers

9
votes

You probably need the mysql client lib for the OS.

sudo apt install libmysqlclient-dev

Then you should be able to:

pipenv install mysqlclient
3
votes

I fixed that problem with the following command:

brew install mysql
0
votes

I would recommend you to install the file first. On windows I used pip install "mysqlclient-1.3.13-cp35-cp35m-win_amd64.whl" and the tried: pip install mysqlclient. It worked well.

0
votes

if you are on Centos

Try: yum install mariadb-devel

this package includes the missing mysql-config

0
votes

First install python-dev

sudo apt-get install python3-dev

and then install mysqlclient-dev version

sudo apt-get install python3-dev libmysqlclient-dev

-2
votes

Try:

sudo apt-get install libmysqlclient-dev

and then:

sudo apt-get install libmariadbclient-dev