看起来你还没有正确安装python开发的头文件和静态库。使用包管理器在系统范围内安装它们。
For (Ubuntu, Debian...):apt
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
For (CentOS, RHEL...):yum
sudo yum install python-devel # for python2.x installs
sudo yum install python3-devel # for python3.x installs
对于 (Fedora...):dnf
sudo dnf install python2-devel # for python2.x installs
sudo dnf install python3-devel # for python3.x installs
For (openSUSE...):zypper
sudo zypper in python-devel # for python2.x installs
sudo zypper in python3-devel # for python3.x installs
对于(高山...):apk
# This is a departure from the normal Alpine naming
# scheme, which uses py2- and py3- prefixes
sudo apk add python2-dev # for python2.x installs
sudo apk add python3-dev # for python3.x installs
对于(Cygwin...):apt-cyg
apt-cyg install python-devel # for python2.x installs
apt-cyg install python3-devel # for python3.x installs
注意:python3-dev不会自动覆盖python3的所有次要版本,如果您使用的是python 3.8,则可能需要安装python3.8-dev。