23

I have installed python 2.7.6 from source, but can't find how to install python-devel for python 2.7

yum install python27-devel

doesn't work. How to install it?

Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
Deadly
  • 2,034
  • 6
  • 24
  • 32
  • I followed this link: http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/ and it worked just fine for me. Try that and please let us know what you had got! Cheers! – Sharif Mamun Apr 23 '14 at 01:24
  • Python 2.7 has been installed and works very well, but this question about installation python27-devel package. – Deadly Apr 23 '14 at 19:41
  • 1
    The devel package contains header files necessary for compilation of native binding in Python modules. Note that, when installing Python 2.7 from source using the `./configure && make && make install` trinity, there is no python27-devel package available. CentOS 6.x does not have Python 2.7 included. If you want to build an .src.rpm or package that depends on Python 2.7 sources, you should make those sources include the sources/headers from your local install. [Please also read CentOS notes on source installs](http://wiki.centos.org/PackageManagement/SourceInstalls) – try-catch-finally May 25 '15 at 15:41
  • the above comment should be the accepted answer as each of the questions below only provide 1. a python 2.6 devel version and 2. a standalone python version, neither answer the question – sijpkes Jan 12 '17 at 05:14

2 Answers2

36

Thanks for your feedback. First of all, if you try to run yum install python27-devel, then you should get the message like this:

No package python27-devel available

Then I followed this link,

yum search python | grep -i devel

This will show you that you have python-devel.x86_64 package available if your OS is a 64 bit OS. If I am correct, then the following command should work fine as shown in the accepted answer:

yum  install python-devel.x86_64
Community
  • 1
  • 1
Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
9

I run Centos 6.5 on Virtualbox and this command solved it.

# yum update
# yum install centos-release-SCL
# yum install python27
henrycarteruk
  • 12,708
  • 2
  • 36
  • 40
D Nguyen
  • 129
  • 2
  • 4