8

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 Answers 6

13

You probably need the mysql client lib for the OS.

sudo apt install libmysqlclient-dev

Then you should be able to:

pipenv install mysqlclient
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That's it: sudo apt install default-libmysqlclient-dev/testing 1.0.4 amd64 MySQL database development files (metapackage).
6

I fixed that problem with the following command:

brew install mysql

1 Comment

you have to be on osx to do that
1

First install python-dev

sudo apt-get install python3-dev

and then install mysqlclient-dev version

sudo apt-get install python3-dev libmysqlclient-dev

Comments

0

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.

Comments

-1

if you are on Centos

Try: yum install mariadb-devel

this package includes the missing mysql-config

1 Comment

Hi Pepperish. OP clearly states «I'm using a Debian and with another virtualenv it get the system package»
-2

Try:

sudo apt-get install libmysqlclient-dev

and then:

sudo apt-get install libmariadbclient-dev

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.