2017-06-01 172 views
1

DLIB我這裏的操作說明:按行http://www.pyimagesearch.com/2017/03/27/how-to-install-dlib/無法安裝在Mac OS X

線,除了爲安裝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 

回答

1

您可能需要安裝PAKAGE cmake的。

當我試圖在virtualenv中我的Mac上安裝DLIB就在剛纔,我得到了錯誤

running bdist_wheel 
    running build 
    error: Cannot find cmake, ensure it is installed and in the path. 
    You can install cmake on OSX using `sudo brew install cmake`. 
    You can also specify its path with --cmake parameter. 

因此,我建議嘗試與

brew install cmake 
+0

我已經安裝了安裝CMake'cmake'儘管如此,還有助推。和boost-python – chibro2

+0

你在你的virtualenv中安裝了cmake嗎?當您嘗試運行pip install dlib時,是否還有任何錯誤?或者它看起來是否安裝得很快? – cosinepenguin

+0

不,我在virtualenv之外安裝'cmake,boost,boost-python'。我安裝好dlib,它安裝得非常快。我編輯了上面的問題以獲得快速安裝後獲得的消息。 – chibro2