我已經安裝numpy的和OpenCV採用的MacPorts按照these instructions,但是當我嘗試import cv
或import cv2
我只是得到了段錯誤,我不知道爲什麼「進口CV2」時。Python的「分割故障:11」運行「進口品種」或
有什麼建議嗎?
$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Segmentation fault: 11
$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Segmentation fault: 11
對不起有這麼幾個細節,但是這是一個新的電腦和我的MacPorts安裝它只是爲了這一點,這些都是我安裝了唯一的東西與macports,所以我不知道爲什麼這不起作用。
編輯:現在我更困惑。
翻翻崩潰報告,我發現這一點:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
所以,在黑暗中拍攝,我跑了Python作爲超級用戶:
$ sudo python
Python 2.7.9 (default, Dec 13 2014, 15:13:49)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>>
以超級用戶身份,一切都顯得運行良好。這怎麼可能?
嘗試修復您的庫的權限,因爲我看到只有root可以訪問它們。 – artemdevel 2015-02-23 09:29:56