Segmentation fault while import cv2 in centos [closed]
I'm installing Opencv3 on Centos 2.6 with Python 2.6. I get the error when I import cv
. I get a Segmentation fault
error.
I'm installing OpenCV like this:
yum update && \
yum install -y libjpeg-turbo && \
yum install -y libtiff-devel && \
yum install -y libpng-devel && \
yum install -y cmake python-devel numpy gcc gcc-c++ gtk2-devel libdc1394-devel libv41-devel ffmpeg-devel gstreamer-plugins-base-devel && \
yum groupinstall -y "Development Tools"
cmake -D CMAKE_BUILD_TYPE=RELEASE -D \
CMAKE_INSTALL_PREFIX=/usr/local -D \
OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules/ ..
make -j4
make install
/usr/local/lib/python2.6/site-packages/cv2.so /usr/lib/python2.6/site-packages/
Importing cv2 gives a segmentation fault error. I get the following output:
[root@localhost ~]# python
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Segmentation fault
it's probably a better idea, to build cv2.pyd statically:
I'm unaware what the difference is? can you please explain. if I use that flag, will it make the
cv2.so
that I then move to PYTHON PATH?this way, cv2.so will be no more dependant on opencv so's at runtime
(but again, we don't know the reason for the crash, this is just a blunt guess)
well, what do you know...that worked. It created a
cv2.so
as well and after moving it to/usr/lib/python2.6/site-packages/
i was able to importcv2
.is it resolved, then ? can we close it ?