Hi everyone I hope someone could help solve this issue,I'm trying to install openCV 3.3.0 with python 3.5 on the raspberry pi 3 for the second time ( first time I got no module named cv2 ) but this time I didn't even got there , it seems like I'm blocked here with the error of 'segmentation fault' and i can't understand why ! this is what I typed in the terminal

pi@raspberrypi:~ $ source ~/.profile 
pi@raspberrypi:~ $ workon cv 
(cv) pi@raspberrypi:~ $ cd opencv-3.3.0
(cv) pi@raspberrypi:~/opencv-3.3.0 $ cd build
(cv) pi@raspberrypi:~/opencv-3.3.0/build $ ls
(cv) pi@raspberrypi:~/opencv-3.3.0/build $ cmake -DCMAKE_BUILD_TYPE=RELEASE\
 -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
 -D PYTHON_EXECUTABLE=/home/pi/.virtualenvs/cv/bin/python3.5 \
 -D PYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \
 -D PYTHON_NUMPY_INCLUDE_DIR=/home/pi/.virtualenvs/cv/lib/python3.5/site- 
    packages/numpy/core/include \
 -D PYTHON_PACKAGES_PATH=/home/pi/.virtualenvs/cv/lib/python3.5/site- 
   packages \
  Segmentation fault
  • What does the 'workon' command do? I've never seen it before. – John Hawthorne Apr 15 '18 at 21:47
  • 'workon' is for the python virtual environment – Med Nour Apr 21 '18 at 0:08

Could be running out of memory. Use htop to view cpu and ram usage when running command. Configure your RPI to add swap memory if needed.


I did encounter this same scenario.

It was fixed when I change the uSD card, from 8 GiB to 16 GiB Class 10 then re-image the new uSD card using latest raspbian.

  • thank you but I m using 32 Gib class 10 SD card with stretch on it so it's not the problem – Med Nour Apr 21 '18 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.