我跟着this tutorial安装了dlib但是当我运行pip install dlib
时我得到了
收集dlib
使用缓存的dlib-19.4.0.tar.gz 为收集的包构建轮子:dlib
为dlib运行setup.py bdist_wheel ...错误
从命令/home/leo/.virtualenvs/py3_dlib_tutorial/bin/python3 -u -c完成输出“import setuptools,tokenize; file ='/ tmp / pip-build-4luevi_i / dlib /setup.py';f=getattr(tokenize,'open',open)( file ); code = f.read()。replace('\ r \ n','\ n' ); f.close(); exec(编译(代码,文件,'exec'))“bdist_wheel -d / tmp / tmpv2rhc6cbpip-wheel- --python-tag cp36:
运行bdist_wheel
运行构建
检测到的Python架构:64位
检测到的平台:linux
配置cmake ...
/ usr / bin / cmake:/home/leo/anaconda3/lib/libcurl.so.4:没有可用的版本信息(/ usr / bin / cmake要求)
/ usr / bin / cmake:/home/leo/anaconda3/lib/libstdc++.so.6:找不到版本“CXXABI_1.3.9”(/ usr / bin / cmake要求)
/ usr / bin / cmake:/home/leo/anaconda3/lib/libstdc++.so.6:找不到版本`GLIBCXX_3.4.20'(/ usr / bin / cmake要求)
/ usr / bin / cmake:/home/leo/anaconda3/lib/libstdc++.so.6:找不到版本`GLIBCXX_3.4.21'(/ usr / bin / cmake要求)
/ usr / bin / cmake:/home/leo/anaconda3/lib/libstdc++.so.6:找不到版本`GLIBCXX_3.4.21'(/usr/lib/x86_64-linux-gnu/libjsoncpp.so要求0.1)
错误:cmake配置失败!
任何建议如何解决?
更新
我正在使用ubuntu 16.04
我所注意到的是,当我运行sudo pip install dlib
时它可以工作但是
然后我得到
(py3_dlib_tutorial) ~$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dlib'
更新
似乎在此之前修复了导致错误
我在.bashrc中禁用了这一行
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/leo/anaconda3/lib
这是使mkvirtualenv
工作的必要条件。
现在pip install dlib
工作了,但我仍然遇到类似的错误
python
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/leo/anaconda3/lib/python3.6/site-packages/dlib/__init__.py", line 1, in <module>
from .dlib import *
ImportError: /home/leo/anaconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_python-py35.so.1.58.0)
答案 0 :(得分:1)
解决此错误:
python
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/leo/anaconda3/lib/python3.6/site-packages/dlib/__init__.py", line 1, in <module>
from .dlib import *
ImportError: /home/leo/anaconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-
gnu/libboost_python-py35.so.1.58.0)
您需要从Python 3.6迁移到Python 3.5。 如果您使用的是anaconda,可以通过设置新环境来完成:
conda create -env_name python=3.5 anaconda
activate env_name
conda install -c menpo dlib
这应该可行,你的dlib工作正常。