в Fedora запускает это для Python 2:
sudo dnf install python2-devel
и для Python 3:
sudo dnf install python3-devel