问题描述
运行需要mpi的命令时,它失败并显示
error while loading shared libraries: libmpi_cxx.so.40: cannot open shared object file: No such file or directory
我正在conda环境pytorch_p36
中运行它。
但是,我检查了在相同的conda环境中是否存在libmpi_cxx.so.40
。
命令
locate libmpi_cxx
/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so
/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so.40
/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so.40.20.1
PATH
或LD_LIBRARY_PATH
是否存在问题?
如果可以的话如何确保anaconda环境库被2个环境变量所吸收?
解决方法
尝试一下:
LD_LIBRARY_PATH=$CONDA_PREFIX/lib [[rest of your command,e.g. python foo.py]]