Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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
share|improve this answer
    
thanks alot sir... saved my time.. but can you please explain what i was missing and what these lines do for ldconfig? –  Astha Oct 31 '11 at 8:28
    
or link to any tutorial from where i can get answers to my question like this? –  Astha Oct 31 '11 at 8:30
    
    
thanks alot for the help :) –  Astha Oct 31 '11 at 8:52
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.