Reputation: 35521
I installed OpenCV via sudo brew install opencv
.
Then I added PYTHONPATH
* to my ~/.profile
as brew info opencv
says**. With env
I checked that the path was loaded.
Now everytime I try to import cv
, Python gives following error: Fatal Python error: PyThreadState_Get: no current thread Abort trap
.
What should I do?
*PYTHONPATH=/usr/local/lib/python2.7/site-packages/:
** actually, it points to folder python2.6
but 2.7 is the Python version I use and cv 2.2. supports it.
Upvotes: 0
Views: 6068
Reputation: 11950
cv 2.2 might well support it, but you MUST not mix versions like that. You must use the version built for 2.7 with 2.7, and the version built for 2.6 with 2.6
I seem to think that cv is a python library that depends on a C library - in that case, you can not mix the libraries like that.
cv will need to be re-compiled against 2.7 if you have only a 2.6 version of it.
That said, this type of Fatal Error suggests a bug in the cv library, however, if you're mixing versions like this, then the result is undefined. (It might work by chance, or it might fail randomly as it has for you).
Upvotes: 1