1

I have already installed numpy and scipy via pip (both import properly) and have the latest XCode with command line tools. Opencv used to work at one point but is now causing a segfault when I attempt to import it in python. I'm using python 2.7.3 installed through brew.

I attempted gdb python with run -c "import cv2" and only received:

#0  0x00007fff5fc01028 in __dyld__dyld_start ()
#1  0x0000000100000000 in ?? ()

In response to the backtrace. My PYTHONPATH is set to "/usr/local/lib/python2.7/site-packages:$PYTHONPATH". I've tried reinstalling using the build-from-source options along with --use-clang, --use-llvm, and --use-gcc just to see if it's a weird compiler issue. I also attempted to export GCC=gcc-4.2 and GXX=g++-4.2 before compiling.

Any ideas on troubleshooting this install?

4

1 回答 1

1

原来这是一个编译器问题。因为我想默认使用 brew 安装,所以我的路径中首先有 /usr/local/bin 。Opencv 使用 brew 的 gcc 4.7 版进行编译。看起来好像在导出 GCC=gcc-4.2 和 GXX=g++-4.2 之后,自制软件没有引用这些环境变量来找出它应该使用哪个编译器。

于 2012-10-22T19:39:19.860 回答