Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find Python.h file on CentOS

Tags:

python

c

centos

I am trying to compile a Python extension written in C on a CentOS machine. I am getting

error: Python.h: No such file or directory 

It works fine on ubuntu, where I have python-dev installed using apt-get.

I tried installing python-devel using

yum install python-devel 

but it is already installed. How do I fix this error?

like image 998
yzernik Avatar asked Sep 12 '12 01:09

yzernik


People also ask

How do I fix python H No such file or directory?

You encounter "Python. h: No such file or directory" error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.

Which python No python in CentOS?

Unlike other Linux distributions, Python is not installed by default on CentOS 8. As you already know, there are two Python versions. Python 2 support ends in 2020. Python 3 is the present and future of the language.

Is python installed by default on CentOS?

You don't need to do anything in order to install Python 3 on CentOS 8 as it is installed by default. As you can see, at the time of this writing, Python 3.6. 8 is the default Python 3 programming language interpreter on CentOS 8. As you can see, you can access Python 3 as either python3 (/usr/bin/python3), or python3.


1 Answers

If you using python3 You could install python34-devel for that

It's available on EPEL Repository and has python34-devel package available

You simply just run this command to get it installed

yum install python34-devel 

Hope it's help

*note At this time python34-devel is the most updated version of python 3.4

like image 141
Aditya Kresna Permana Avatar answered Sep 28 '22 16:09

Aditya Kresna Permana