【发布时间】:2017-11-02 19:00:43
【问题描述】:
我正在按照这里的说明进行操作:http://www.pyimagesearch.com/2017/03/27/how-to-install-dlib/
逐行,除了为安装python3的那一行。我做了一个虚拟环境,在 virtualenv 里面,做了这四行:
$ pip install numpy
$ pip install scipy
$ pip install scikit-image
$ pip install dlib
与说明不同,最后一行需要几秒钟,而不是 15 分钟。安装完后打开ipython,试了import dlib,收到这样的信息:
----> 1 from .dlib import *
2 __version__ = "19.4.0"
ImportError: dlopen(/Users/myname/Documents/camera-project/code/story-board/cv/lib/python2.7/site-packages/dlib/dlib.so, 2): Library not loaded: @rpath/libmkl_rt.dylib
Referenced from: /Users/myname/Documents/camera-project/code/story-board/cv/lib/python2.7/site-packages/dlib/dlib.so
Reason: image not found
我认为这意味着dlib 没有正确安装,但我不确定我做错了什么?
另外,我应该补充一点,我的 mac 上没有anaconda,所以这不是问题。但是今天早些时候我做到了,我可以毫无问题地加载dlib,大概是因为我正在运行anaconda 分发的python 版本,我假设dlib 带有anaconda。然而,anaconda 分发的 X11 已损坏,因此我必须从系统中完全删除 anaconda 并重新开始。
编辑
这是我“成功”安装 dlib 后收到的消息:
:/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Installing collected packages: dlib
Successfully installed dlib-19.4.0
【问题讨论】: