PyGears Error: No system libbz2 headers could be found. Make sure your system has a libz installed

PyGears Error: No system libbz2 headers could be found. Make sure your system has a libz installed

我在安装 PyGears 时遇到错误 No system libbz2 headers could be found. Make sure your system has a libz installed。有什么建议吗?

如果您在 WSL 上使用Ubuntu,请试试这个。

sudo apt install libbz2-dev

包的名称可能因 Linux 发行版而异,但大致就是这样。