0

i installed python2.6 before in

/ust/local/bin

but now i removed it and installed a new python2.6.4 in

/opt/python2.6

i installed from the article

but on mid way only where they say to check python it says

[root@domain ~]# python
 /opt/python2.6/bin/python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

but when i open

/opt/python2.6/lib

i can found this file. please tell me whats wrong with this?

quanta
  • 50,327
  • 19
  • 152
  • 213
Astha
  • 243
  • 2
  • 6
  • 15

2 Answers2

2

When you compile python2.6 with --prefix=/opt/python2.6, the binaries will be installed at /opt/python2.6/bin, the libraries at /opt/python2.6/lib, ...

/opt/python2.6/bin/python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

This error means that python is not looking at the path the file is in. So you need to add the library path to /etc/ld.so.conf file and activate it with ldconfig:

# echo "/opt/python2.6/lib" > /etc/ld.so.conf.d/libpython2.6.conf
# ldconfig
quanta
  • 50,327
  • 19
  • 152
  • 213
1

in Step 2 try add LDFLAGS with right path... for example

env LDFLAGS="-L/opt/python2.6/lib -R/opt/python2.6/lib" ./configure --prefix=/opt/python2.6 --with-threads --enable-shared
cadmi
  • 6,858
  • 1
  • 16
  • 22