zhang
zhang

Reputation: 21

install mysql-python using pip on mac os

When I install mysql-python using pip on mac os, I always get this error, how can I solve this problem?

    ld: warning: directory not found for option '-L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.Internal.sdk/usr/local/libressl/lib'
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'cc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-UEOYdV/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-UEOYdV/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-EgQ8P0/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Upvotes: 1

Views: 401

Answers (2)

Razzi Abuissa
Razzi Abuissa

Reputation: 4152

As AMC posted in a comment, this error can occur when using the builtin MacOS Python 2. Use a tool like pyenv to install a standard Python distribution, create a virtual environment, and try again.

Upvotes: 1

techdoodle
techdoodle

Reputation: 115

Try:

pip install --upgrade setuptools

Upvotes: 1

Related Questions