After installing mongodb using Python, the following error is reported when mongod is executed
mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
Find the virtual environment used, for example, the name of my virtual environment is torch, use the following command to check whether there is a libcrypto.so.1.1 file 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 June 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 lib directory, use the following command to perform a global search
find / -name 'libcrypto.so.1.1'
Observe the results of the search, find the existing directory is to use the above
sudo ldconfig directory path.