首页 > 编程语言 >fatal error: Python.h: No such file or directory

fatal error: Python.h: No such file or directory

时间:2023-02-25 14:07:54浏览次数:41  
标签:file No Python apt devel installsFor install python3 python2


fatal error: Python.h: No such file or directory

过程: 通过pip install 某个库,发生了一下错误,找不到 Python.h的头文件

fatal error: Python.h: No such file or directory_pip

解决方案

搜索StackoverFlow,我的环境是CentOS,所以执行​​sudo yum install python3-devel​​后,再去pip install 那个库,就都ok了

For apt (Ubuntu, Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs

For yum (CentOS, RHEL…):

sudo yum install python-devel    # for python2.x installs
sudo yum install python3-devel # for python3.x installs

For dnf (Fedora…):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel # for python3.x installs

For zypper (openSUSE…):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel # for python3.x installs

For apk (Alpine…):
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

For apt-cyg (Cygwin…):

apt-cyg install python-devel   # for python2.x installs
apt-cyg install python3-devel # for python3.x installs

fatal error: Python.h: No such file or directory_centos_02


标签:file,No,Python,apt,devel,installsFor,install,python3,python2
From: https://blog.51cto.com/u_14062833/6085414

相关文章