1 报错1

ld: library not found for -lssl

遇到相关报错:

Running setup.py install for mysqlclient ... error

XXXXX

ld: library not found for -lssl
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      error: command '/usr/bin/clang' failed with exit code 1

 

解决:通过设置添加openssl库文件到LIBRARY_PATH

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl@3/lib

2 报错2

或者ld: library not found for -lzstd

 ld: can't map file, errno=22 file '/usr/local/Cellar/zstd/1.5.2/lib' for architecture x86_64

解决

brew reinstall zstd

CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib"

参考:

解决MacOS pip安装mysqlclient错误 - 云+社区 - 腾讯云

[macOS] macOS Big Sur ld: library not found for -lzstd - DavidHHuan - 博客园

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐