Python headers not found错误解决办法


安装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-devpython3-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 出错


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM