How to fix Python Installation Error while loading shared libraries: libssl.so.1.0.0? [Solved]

Updated on September 2, 2017

Question: Thanks to the guide on How to compile and install Python with OpenSSL Support. However, the installation failed with an error message error while loading shared libraries: libssl.so.1.0.0 cannot open shared object file during make. According to the installation guide, I installed OpenSSL and then edited Setup.dist file to refer the OpenSSL installation path. The OpenSSL installation directory is /usr/local/openssl. 

Below is the complete error message:

[Python-3.5] $ make
 ./python: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
 make: *** [pybuilddir.txt] Error 127

Please suggest a solution.

Answer:

There are few things that you might need to check:

python openssl error

1) OpenSSL developer package will provide all necessary SSL libraries. Make sure openssl-devel package is installed as shown below:

# rpm -qa |grep openssl
openssl-devel-1.0.1e-42.el6_7.2.x86_64
openssl-1.0.1e-42.el6_7.2.x86_64

If rpm -qa lists openssl-devel, then you mostly probably have libssl libraries installed. If not, you need to install it first.

# yum install openssl-devel

2) Check for libssl and libcrypto shared object files: Look out for the lib folder under OpenSSL installation directory (in case of yum install, the libraries might be present in /usr/lib or /usr/lib64). For example, if the OpenSSL is installed in /usr/local/openssl, then you will find lib folder containing library files as shown below:

Sample output:

# cd /usr/local/openssl/lib
# ls
engines libcrypto.so libssl.a libssl.so.1.0.0
libcrypto.a libcrypto.so.1.0.0 libssl.so pkgconfig

Lookout for the libssl and libcrypto shared object files.

3) Set library to the path: You might have the libraries installed, but may not be in the path. Add OpenSSL libraries to ld.so.conf file as shown below:

# vim /etc/ld.so.conf

Add below line to the end of the file:

/usr/local/openssl/lib/

Note: The path might vary depending upon your installation.

# ldconfig

Hope it works.

Was this article helpful?

Related Articles

Leave a Comment