I was trying to get a fresh Django 1.10 project setup on macOS Sierra using MySQL and Python 3.5 in a venv but
pip install mysqlclient was failing with the error:
ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1
As is often the case after some searching I came into the solution on Stack Overflow.
mysqlclient needs to link against the homebrew version of openssl I have installed:
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install mysqlclient
The solution post also mentions that installing the xcode command line tools via:
will provide the required ssl libs for the system installed version of python (2.7 on Sierra), it will not work for python in a virtual environment.