error: command 'xcrun' failed with exit status 1

1.背景
在新的mac上安装autocronjob项目,遇到一些报错,这里整理一下。
2.环境
Mac 10.15.1
Python 3.7.3
django 2.2
3.报错

    xcrun -sdk macosx clang -arch x86_64 -bundle -undefined dynamic_lookup build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mariadb/10.4.11/lib -lmariadb -lz -liconv -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'xcrun' failed with exit status 1

网上有很多人都说这种解决办法https://www.jianshu.com/p/308d7be8b8df
,我试过了,没有用处。
4.解决

1. brew install mysql-client
2. vim ~/.zshrc
export PATH="/usr/local/opt/mysql-client/bin:$PATH"
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
3. source ~/.zshrc
4. pip install mysqlclient

包括经常会出现mysql_config not found错误的,都可以用使用

brew install mysql-client
或者
brew install mysql-connector-c

就可以解决。

你可能感兴趣的:(error: command 'xcrun' failed with exit status 1)