我已经安装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