且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

python:加载共享库时出错:libpython3.4m.so.1.0:无法打开共享对象文件:没有这样的文件或目录

更新时间:2021-12-13 07:56:13

尝试将 python3.4 的 lib 路径添加到 $LD_LIBRARY_PATH 环境变量中.

Try adding the python3.4's lib path to the $LD_LIBRARY_PATH environment variable.

首先找出python3.4的lib路径(取决于你是如何安装python3.4的)

First find out the lib path of python3.4 (depends on how you installed python3.4)

对我来说是:/opt/python361/lib,然后将其添加到环境变量中,如下所示:

For me it was: /opt/python361/lib, then add it to environment variable like so:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python361/lib

附言我在使用 virtualenvpython3.6 时遇到了类似的问题,我像这样修复了它:

P.S. I came across a similar problem while using virtualenv with python3.6, and I fixed it like so:

  • 首先,将 include 附加到 /etc/ld.so.conf (类似于:include/opt/python361/libinclude/usr/local/lib)
  • 然后,通过运行 sudo/sbin/ldconfig -v 来激活新配置.
  • First, append include <lib path of python3.x> to /etc/ld.so.conf (Something like: include /opt/python361/lib or include /usr/local/lib)
  • Then, activate the new configuration by running sudo /sbin/ldconfig -v.