1

I have been trying to install MySQL in python using the following command:

pip install MySQL-python

However, I receive the following error:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/78/6x078vmd591d01w_p5l6wtk40000gp/T/pip-install-xBIsBR/MySQL-python/

Now, I realize there are many sources that say to simply run this:

pip install --upgrade setuptools

I have tried this, and I get this:

Requirement already up-to-date: setuptools in /Library/Python/2.7/site-packages (41.0.0)

So it seems to me that my setuptools are fine, but I am still unable to install MySQL. Any suggestions?

Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
aperez121
  • 33
  • 4

1 Answers1

0

Although you get a different error, I believe this answer should be useful. Therefore, change the content of /usr/local/bin/mysql_config from

Libs = "-L $ pkglibdir "
Libs = " $ libs   -l"

to

Libs = "- L $ pkglibdir"
Libs = "$ libs -lmysqlclient -lssl -lcrypto"

and finally re-install mysql-python

pip install mysql-python
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
  • Sorry, I've never gone about editing a script, kind of a newbie. How would I do that? Or if you have a resource for me to look at instead that would also help. – aperez121 Apr 07 '19 at 22:15
  • open the file with a text editor, for example `vi /usr/local/bin/mysql_config` and make the necessary changes. – Giorgos Myrianthous Apr 07 '19 at 22:16