Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output while installing mysqlclient

Viewed 6010

I am trying to install mysqlclient for python, but I always get this error when I try:

$ pip3 install mysqlclient

error

How can I resolve this issue?

1 Answers

Looking at the error message, it seems that there is an OS Error, and judging by the terminal layout, you're using Linux.

It seems that to install this package on Linux, there are extra instructions to follow, mentioned on the module's github page:

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

Related