ld: library not found for -lzlib clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Failed to build mysqlclient ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
时间: 2023-06-17 08:03:40 浏览: 439
20191118-RISCV-CodeSize.pdf
这个错误提示是在安装 mysqlclient 时出现的。根据错误提示,似乎是缺少 zlib 库,你可以尝试安装 zlib 库并重新安装 mysqlclient。
如果你使用的是 macOS 系统,可以通过 Homebrew 安装 zlib:
```
brew install zlib
```
如果你使用的是 Linux 系统,可以通过系统包管理器安装 zlib:
```
sudo apt-get install zlib1g-dev # Ubuntu/Debian
sudo yum install zlib-devel # CentOS/Fedora
```
安装完 zlib 后,再重新安装 mysqlclient:
```
pip install mysqlclient
```
如果还是无法解决问题,可以尝试在安装 mysqlclient 时指定库文件路径:
```
pip install mysqlclient --global-option=build_ext --global-option="-L/usr/local/opt/zlib/lib" --global-option="-I/usr/local/opt/zlib/include"
```
需要根据你实际的 zlib 安装路径进行调整。
阅读全文