mac下python安装mysqlclient报ld: library not found for -lssl

报错:

building 'MySQLdb._mysql' extension
    creating build/temp.macosx-10.9-x86_64-3.8
    creating build/temp.macosx-10.9-x86_64-3.8/MySQLdb
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,4,3,'final',0) -D__version__=1.4.3 -I/usr/local/Cellar/mysql/8.0.27_1/include/mysql -I/Users/ivanli/Downloads/RedisAutomation/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.8/MySQLdb/_mysql.o
    gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.8/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.27_1/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv -o build/lib.macosx-10.9-x86_64-3.8/MySQLdb/_mysql.cpython-38-darwin.so
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'gcc' failed with exit status 1

解决方法:
https://github.com/brianmario/mysql2/issues/795#issuecomment-337006164

image.png

你可能感兴趣的:(mac下python安装mysqlclient报ld: library not found for -lssl)