重新编译python(不影响原来安装的库文件),加入--enable-shared
./configure --prefix=/usr/local/python3 --enable-shared
然后make && make install就好了
现在再次打开python的时候,会报错,
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
需要依次执行
echo "/usr/local/python3/lib/" >> /etc/ld.so.conf
ldconfig