6

I am trying to install MySQLdb for Python on my mac so I can use it to test. I am running OS X 10.11.4. Everywhere I look says to use

pip install MySQL-python

Every time I do that I get an error saying.

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/4s/4wwhr6zj59sf0c4qkprqbsp80000gn/T/pip-build-042_KK/MySQL-python/

I am running the command just right when I open a new shell, should I change the path?

1 Answer 1

9

install mysql connector using homebrew brew install mysql-connector-c then install mysql-python using pip pip install mysql-python or try PyMySQL its a pure python client library, you can install using pip install PyMySQL and upgrade setuptools. pip install --upgrade setuptools.

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

1 Comment

brew install mysql-connector-c produces an error on macOS Sierra: Error: Cannot install mysql-connector-c because conflicting formulae are installed. mysql: because both install MySQL client libraries Please brew unlink mysql before continuing. Unlinking removes a formula's symlinks from /usr/local. You can link the formula again after the install finishes. You can --force this install, but the build may fail or cause obscure side-effects in the resulting software.

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.