Skip to content Skip to sidebar Skip to footer

Ubuntu 17: Can't Install Mysqlclient

Trying to follow a Django tutorial but I cannot install mysqlclient. The tutorial claims that I can do so with the following command: pip install mysqlclient but this generates thi

Solution 1:

You should also install the mysql and python development headers and libraries: https://github.com/PyMySQL/mysqlclient-python#prerequisites

Solution 2:

I was facing the same problems, but following the instructions in the Official mysqlclient documentation fixed it for me

but just to clarify I was running python 3.5 from a virtual environment and after installing the prerequisites, it all worked fine

Solution 3:

The following solved it for me :

You may need to install the Python 3 and MySQL development headers and libraries like so:

$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential # Debian / Ubuntu

% sudo yum install python3-devel mysql-devel # Red Hat / CentOS

Then you can install mysqlclient via pip now:

$ pip install mysqlclient

Source : https://github.com/PyMySQL/mysqlclient#prerequisites

Solution 4:

I had also similar issue on Centos 6, where there was a problem with mysql migration to maria, I had some conflicts, but finally I installed:

 yum list installed |grep MariaDB
MariaDB-client.x86_64  10.2.7-1.el6     @bull                                   
MariaDB-common.x86_64  10.2.7-1.el6     @bull                                   
MariaDB-compat.x86_64  10.2.7-1.el6     @bull                                   
MariaDB-devel.x86_64   10.2.7-1.el6     @bull                                   
MariaDB-server.x86_64  10.2.7-1.el6     @bull  

And the issue was resolved.

Post a Comment for "Ubuntu 17: Can't Install Mysqlclient"