Python Error: mongod: error while loading shared libraries: libcrypto.so.1.1

Reading guide

After installing mongodb in Python, the following error is reported when executing mongod

mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

Solution:

Find the virtual environment used. For example, the name of my virtual environment is torch , and use the following command to check whether the libcrypto. So. 1.1 file exists in the environment

#Switch to the lib directory
cd /root/anaconda3/envs/torch/lib
# Check if the file exists
ls -lh | grep "libcrypto.so.1.1"
-rwxrwxrwx 1 root root 3.2M Jun 4 15:43 libcrypto.so.1.1
# If the file exists execute the following command
sudo ldconfig /root/anaconda3/envs/torch/lib

If there is no in the Lib directory, use the following command for global search

find/-name 'libcrypto.so.1.1'

Observe the search results and find the existing directory by using the above sudo ldconfig directory path

Read More: