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?
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With