安装mysqlclient

1.workon py3
2.pip install mysqlclient

如果报错:

Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/0h/jn4vphd94wsf0sl01jb74p200000gn/T/pip-build-7dif93uz/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/0h/jn4vphd94wsf0sl01jb74p200000gn/T/pip-ljzyp5xt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0h/jn4vphd94wsf0sl01jb74p200000gn/T/pip-build-7dif93uz/mysqlclient/

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

你可能感兴趣的:(安装mysqlclient)