今天装paddle的docker的时候,运行neural search的程序,出现了下面的错误,python环境使用的是anaconda安装的:

ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

解决方法

找出系统中的libpython3.7m.so.1.0的位置

find / -name "libpython*so*"

我的输出为:

/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
/usr/lib/x86_64-linux-gnu/libpython2.7.so
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so
/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5m.so
/usr/local/python3.7.0/lib/libpython3.7m.so
/usr/local/python3.7.0/lib/libpython3.7m.so.1.0
/usr/local/python3.7.0/lib/libpython3.so
/../anaconda3/lib/libpython3.7m.so
/.../anaconda3/lib/libpython3.so
/.../anaconda3/lib/libpython3.7m.so.1.0
/.../anaconda3/pkgs/python-3.7.6-h0371630_2/lib/libpython3.7m.so
/.../anaconda3/pkgs/python-3.7.6-h0371630_2/lib/libpython3.so
/.../anaconda3/pkgs/python-3.7.6-h0371630_2/lib/libpython3.7m.so.1.0

然后我就把我的anaconda下的libpython3.7m.so.1.0复制到/usr/lib/x86_64-linux-gnu目录下,如下面我的示例:

cp  /.../anaconda3/pkgs/python-3.7.6-h0371630_2/lib/libpython3.7m.so.1.0 /usr/lib/x86_64-linux-gnu

参考文献

​​ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory​​