Python Error: mongod: error while loading shared libraries:

Reading guide

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

mongod: error while loading shared libraries: 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 , 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 ""
-rwxrwxrwx 1 root root 3.2M Jun 4 15:43
# 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 ''

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

Read More: