Python headers not foundエラー解決方法

1413 ワード

Python拡張をインストールする場合、Configure error:Python headers not foundエラー解決方法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...)を使用してインストールします.
sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

yum(CentOS,RHEL…)を使用してインストール
sudo yum install python-devel   # for python2.x installs
sudo yum install python34-devel   # for python3.4 installs

dnf(Fedora...)を使用してインストール
sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

zypper(openSUSE...)で取り付ける
sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

apk(Alpine...)を使用してインストール
sudo apk add python2-dev  # for python2.x installs
sudo apk add python3-dev  # for python3.x installs

[1]python-devライブラリの欠落によるmatplotlibのインストールエラー
転載先:https://www.cnblogs.com/TianchiLiu/p/10082473.html