在安裝spot
時,遇到#include "Python.h"
找不到錯誤:
checking Python.h usability... no checking Python.h presence... no checking for Python.h... no configure: error: Python's development headers are not installed.
緣由:
沒法找到 python 庫,#include "Python.h"
出錯 ,缺乏python-dev
或python3-dev
解決:
使用 apt (Ubuntu, Debian…) 安裝python
sudo apt-get install python-dev # for python2.x installs sudo apt-get install python3-dev # for python3.x installs
使用 yum (CentOS, RHEL…) 安裝python3.x
sudo yum install python-devel # for python2.x installs sudo yum install python34-devel # for python3.4 installs
使用 dnf (Fedora…) 安裝ui
sudo dnf install python2-devel # for python2.x installs sudo dnf install python3-devel # for python3.x installs
使用 zypper (openSUSE…) 安裝.net
sudo zypper in python-devel # for python2.x installs sudo zypper in python3-devel # for python3.x installs
使用 apk (Alpine…) 安裝code
sudo apk add python2-dev # for python2.x installs sudo apk add python3-dev # for python3.x installs