Help us understand the problem. What is going on with this article?

CentOS 5.4 に Python 2.7.3 を install

More than 5 years have passed since last update.

ダウンロード

$ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
$ tar xvzf Python-2.7.3.tgz

コンパイル & インストール

$ cd Python-2.7.3
$ ./configure --enable-shared --prefix=/usr/local/python2.7.3
$ make
$ make install

動作確認

$ /usr/local/python2.7.3/bin/python -V
Python 2.7.3

動作確認で下記のエラーが発生したら

$ /usr/local/python2.7.3/bin/python -V
/usr/local/python2.7.3/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

共有ライブラリの確認

$ ldd /usr/local/python2.7.3/bin/python
        libpython2.7.so.1.0 => not found
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003eaa000000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003ea9c00000)
        libutil.so.1 => /lib64/libutil.so.1 (0x0000003eb6a00000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003ea9800000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003ea9400000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003ea9000000)
libpython2.7.so.1.0 => not found

上記の状態の場合、ライブラリへのシンボリックリンクを/lib64配下に作成。

ln -s /usr/local/python2.7.3/lib/libpython2.7.so.1.0 /lib64/
iorionda
怠惰
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away