【发布时间】:2015-04-24 12:41:42
【问题描述】:
我已经按照these instructions, 使用macports 安装了numpy 和opencv,但是当我尝试import cv 或import cv2 时,我只是得到了段错误,我不知道为什么。
有什么建议吗?
$ 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 可以访问它们。
标签: python macos python-2.7 opencv macports