解决方案 解决方案 在终端输入如下内容: sudo apt-get install python-dev 多数情况下是可以解决的,但是避免不了特殊情况出现。有时候需要指定版本,因为我使用的是3.8,所以就要专门安装3.8对应的: sudo apt-get install python3.8-dev