python new install showing error while loading shared libraries
Solution 1
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
Solution 2
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
Related videos on Youtube
Comments
-
Astha almost 2 years
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?
-
Greg Petersen over 12 years