简体   繁体   English

导入错误:libboost_python.so.1.65.1:无法打开共享对象文件:没有这样的文件或目录

[英]ImportError: libboost_python.so.1.65.1: cannot open shared object file: No such file or directory

First of all, I am using ARM7 architecture.首先,我使用的是ARM7架构。 I downloaded dlib library using pre-build wheel file dlib-19.7.0-cp27-cp27mu-linux_armv7l.whl and download Boost.python libraries and built them for python libraries, and when import dlib in python2.7 I got that error我使用预构建的轮文件dlib-19.7.0-cp27-cp27mu-linux_armv7l.whl下载了dlib库并下载Boost.python库并为 python 库构建了它们,当在 python2.7 中import dlib时我得到了那个错误

>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/dlib/__init__.py", line 1, in <module>
from .dlib import *
ImportError: libboost_python.so.1.65.1: cannot open shared object file: No such file or directory

Then I searched for libboost_python.so.1.65.1 in my directories and found it然后我在我的目录中搜索libboost_python.so.1.65.1并找到了它

:~# whereis libboost_python.so.1.65.1
libboost_python.so.1.65: /usr/local/lib/libboost_python.so.1.65.1

and found out that path (/usr/local/lib/) wasn't a part of PATH variable, so, I added it并发现路径 (/usr/local/lib/) 不是PATH变量的一部分,所以,我添加了它

:~# export PATH=$PATH:/usr/local/lib

and made sure that it placed correctly并确保它放置正确

:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/lib

and tried again but nothing, the same error appeared.再次尝试但没有,出现同样的错误。 I also installed libboost-all-dev using apt-get and make update after that but also the same error arise.我还使用apt-get安装了libboost-all-dev并在之后进行了update ,但也出现了同样的错误。 So, what is the reason for that error and how can I overcome it?那么,该错误的原因是什么,我该如何克服呢?

Thanks for advise.谢谢指教。

I've got the same error. 我有同样的错误。 no need to install libboost-dev-all it's an overkill... 无需安装libboost-dev-一切都太过分了...

You did not compile the libboost for python correctly. 您没有为python正确编译libboost。 I've done the same but just with one flag --with-libraries=python and got exactly the same error. 我做了同样的事情,但是只用一个标志--with-libraries = python并得到了完全一样的错误。

I knew my compiling was not good and a few trials got me to make this work. 我知道我的编译效果不佳,并且经过几次尝试使我可以完成这项工作。

wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz \
&& tar zxf boost_1_65_1.tar.gz \
&& cd boost_1_65_1 \
&& ./bootstrap.sh --with-libraries=python --with-python=python3.5 \
&& ./b2 install

pay attention to the flag --with-python=python3.5 you will probably need to pass python2.7 instead 注意标志--with-python = python3.5,您可能需要传递python2.7来代替

here's how you can test it: 测试方法如下:

import dlib
import numpy as np
image = np.arange(100*100*3).reshape(100, 100, 3)
fd = dlib.get_frontal_face_detector()
faces, scores, _ = fd.run(image, 0, 0)
faces, scores, _ = fd.run(image, 0, -100)
print(scores)

-2.38875
-2.77087
-2.82851
-2.84197
-3.05489
-3.0879

if you get an error like this: 如果收到这样的错误:

>>> import dlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/dlib/__init__.py", line 1, in <module>
    from .dlib import *
ImportError: libboost_python3.so.1.65.1: cannot open shared object file: No such file or directory

make sure you add /usr/local/lib to the LD_LIBRARY_PATH 确保将/ usr / local / lib添加到LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

I have a similar problem, I have compiled boost from source and have boost version libboost1.81.0 installed in my /usr/local/lib.我有一个类似的问题,我从源代码编译了 boost,并在我的 /usr/local/lib 中安装了 boost 版本 libboost1.81.0。 But I get the error as follows.但是我得到如下错误。 Openvdb has compiled from source without error. Openvdb 已从源代码编译而没有错误。

        import pyopenvdb
ImportError: libboost_python38.so.1.68.0: cannot open shared object file: No such file or directory

I have tried compiling with the flags as mentioned, aswell as adding我已经尝试使用提到的标志进行编译,以及添加

export LD_LIBRARY_PATH=/usr/local/lib导出 LD_LIBRARY_PATH=/usr/local/lib

to my.bashrc, but still the error remains.到 my.bashrc,但错误仍然存在。

Any ideas?有任何想法吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python`ImportError:libboost_python27.so.1.67.0:无法打开共享对象文件:没有这样的文件或目录` - python `ImportError: libboost_python27.so.1.67.0: cannot open shared object file: No such file or directory ` ImportError:libboost_python.so.1.41.0:无法打开共享对象文件:没有这样的文件或目录 - ImportError: libboost_python.so.1.41.0: cannot open shared object file: No such file or directory ImportError:libboost_iostreams.so.1.61.0:无法打开共享对象文件:没有这样的文件或目录 - ImportError: libboost_iostreams.so.1.61.0: cannot open shared object file: No such file or directory 而导入python。 ImportError:libcublas.so.9.0:无法打开共享对象文件:没有这样的文件或目录 - While Import python. ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory 如何克服 Python ImportError: libmqic_r.so: cannot open shared object file: No such file or directory - How to over come Python ImportError: libmqic_r.so: cannot open shared object file: No such file or directory ImportError:libcudnn.so.5:无法打开共享对象文件:没有这样的文件或目录,带有Tensorflow-gpu的Python 2.7 - ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory, Python 2.7 with Tensorflow-gpu ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录(共享Linux) - ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory (Shared Linux) Pygame:ImportError:libSDL_ttf-2.0.so.0:无法打开共享对象文件:没有这样的文件或目录 - Pygame: ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory Tensorflow-ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录 - Tensorflow- ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory Jupyter:ImportError:libcusolver.so.8.0:无法打开共享库文件:没有这样的文件或目录 - Jupyter: ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM