Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why 'pip install mysqlclient' not working in ubuntu 18.04 LTS

I have just created a virtual environment on my machine (I am running on ubuntu 18.04 LTS). I have the python version of 3.6.7 and now I want to install mysqlclient into my virtual environment.

After I do pip install mysqlclient it didn't work, instead it gave me errors saying;

Command "python.py egg_info" failed with error code 1 in /tmp/pip-install-zd21vfb3/mysqlclient/', and that the msql_config file is not found.

My setup tools are all up to date.

like image 619
Ryan Thompson Avatar asked Dec 05 '18 22:12

Ryan Thompson


People also ask

Why Mysqlclient is not installing?

First, check that you are connected to the internet and it is stable. Try to run the command again. Next, you will have to manually download and install the package if the problem persists. To do this, you can Google the binary file of mysqlclient that is compatible with your device, or you can go to this site.

Does Mysqlclient support Python 3?

This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs.

Does pip install work on Ubuntu?

Pip is a helpful command line package manager and installer for Ubuntu. Using various commands, pip allows you to manage Python software packages from the Ubuntu terminal. In this tutorial, you have learned how to install pip on Ubuntu machines running both Python 2 and Python 3.

Does Ubuntu 18.04 come with pip?

Ubuntu 18.04 has both Python 2 and Python 3 installed by default and hence it has two possible variants of PIP for each Python versions. Pip, by default, refers to the Python 2 version. Pip for Python 3 is referred to as pip3. Python 2 is deprecated and not available in Ubuntu 20.04 and higher versions.


1 Answers

mysqlclient has a dependency on the mysql client & dev packages being installed. In order to fix this on ubuntu, you have to use apt-get to install a couple of mysql packages.

In your case, it looks like the missing mysql_config might be missing on your system. You can fix that by installing libmysqlclient-dev on ubuntu bionic.

like image 70
danblack Avatar answered Oct 22 '22 11:10

danblack