5

I've installed python27 on my CentOS 6.6 system using this command:

% yum install python27

The install went successfully but I cannot find the python27 executable. It is not in the following places:

/bin
/usr/bin
/usr/local/bin

Running the yum command again tells me that there is nothing to do.

[ray@localhost bin]$ sudo yum install python27
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.mit.edu
 * extras: mirrors.lga7.us.voxel.net
 * rpmforge: apt.sw.be
 * rpmforge-extras: apt.sw.be
 * updates: centos-distro.1gservers.com
Setting up Install Process
Package python27-1.1-25.el6.x86_64 already installed and latest version
Nothing to do
[ray@localhost bin]$

Where could python27 be?

I see no evidence that it is actually installed other than the message saying that it has been installed. Is there a step I'm missing to get it into /usr/bin?

Ray Salemi
  • 5,247
  • 4
  • 30
  • 63

3 Answers3

2
rpm -ql <package name>

will show you all files in your installed rpm.

Paul Zakharov
  • 515
  • 2
  • 15
  • So you could use `rpm -ql python27` and see where your python27 installed. – Paul Zakharov Jun 10 '16 at 12:44
  • Thanks. This is what I see. [ray@localhost bin]$ sudo yum install python27 Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile Package python27-1.1-25.el6.x86_64 already installed and latest version Nothing to do [ray@localhost bin]$ rpm -ql python27 (contains no files) [ray@localhost bin]$ **rpm -ql python** /usr/bin/pydoc /usr/bin/python /usr/bin/python2 /usr/bin/python2.6 /usr/share/doc/python-2.6.6 /usr/share/doc/python-2.6.6/LICENSE /usr/share/doc/python-2.6.6/README /usr/share/man/man1/python.1.gz – Ray Salemi Jun 10 '16 at 13:00
  • It's almost good... But you should run `rpm -ql python27` (not `rpm -ql python` - because it's for python 2.6) it will show you the path where python27 is installed. – Paul Zakharov Jun 10 '16 at 15:01
  • 3
    Sadly I ran it: rpm -ql python27 --> (contains no files) – Ray Salemi Jun 10 '16 at 16:11
  • It seems that 'yum install' is not really doing an install. There is no python in /usr/local/bin after the install. – Ray Salemi Jun 10 '16 at 17:44
  • No, I should not say "is not really doing an install", but rather that package python27 could be empty, transitional or something like that. In this case... a) at first `yum info python27` give you some info and may be explanations about this package; – Paul Zakharov Jun 11 '16 at 18:20
  • b) you could try to download rpm-package of python27 `yum install yum-downloadonly` then `yum install --downloadonly --downloaddir=./ python27` That will download python27.rpm into your current directory. Then `rpm2cpio python27.rpm |cpio -ivd` could extract the content of python27.rpm so you could be sure that there is nothing in this package. Be careful, probably python27.rpm have some more complicated name (like python27.el6.rpm etc). – Paul Zakharov Jun 11 '16 at 18:21
1

Try:

alternatives --list | grep python

This lists all packages along with paths, which have multiple installed versions on the system and then greps python in the list.

Furhan S.
  • 1,494
  • 2
  • 13
  • 22
1

I had the same problem. Finally I installed python 2.7 following the instructions in this document. It compiles python 2.7 using make altinstall, thus you keep the old version:

cd /usr/src
sudo wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
sudo tar xzf Python-2.7.6.tgz
cd Python-2.7.6
sudo ./configure
sudo make altinstall

Check with:

python2.7 -V

Hope it helps.

David G
  • 6,803
  • 4
  • 28
  • 51
e_v_e
  • 478
  • 3
  • 16