Pergunta

I'm now on my third full day this week of trying to get OpenCV to work with Python. (I have been trying on and off for the past 6 months).

I get this error

Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
>>> import cv
dlopen("./cv.so", 2);
Fatal Python error: Interpreter not initialized (version mismatch?)

and then it crashes (core dumps). python -v gives nothing after the dlopen.

Any ideas from anyone who actually knows about this error?

Foi útil?

Solução

Every time I've tried to compile OpenCV on OS X, it will claim to find my custom installed Python but then link against the system Pyton (2.6) instead.

This is what is happening here, if you view the full compiler output for OpenCV it actually linked itself against 2.6 and will be unusable in your custom 2.7.

If you can figure out how to get OpenCV to properly link against a user-provided Python, then please:

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top