0

enter image description here illegal instruction when importing opencv into python compiled opencv3 for python 3 by using these commands

$ cd ~/opencv-3.3.0/
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D BUILD_TESTS=OFF \
    -D INSTALL_PYTHON_EXAMPLES=OFF \
    -D BUILD_EXAMPLES=OFF ..
i had set environment variable by these commands
 $sudo pip install virtualenv virtualenvwrapper
 $ sudo rm -rf ~/.cache/pip 

and appended the following code on my ~/.profile file

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

I was trying to install optimized opencv for python in raspberry pi2. Instructed from the following website https://www.pyimagesearch.com/2017/10/09/optimizing-opencv-on-the-raspberry-pi/. But when I run the command import cv2 in python it shows illegal instruction error. What to do?

  • 1
    What's the question? How to import cv2? How to compile opencv-3.3.0? Or what exactly do you want to ask? Please don't use images from text output, instead paste the text direct into the question. – Ingo Apr 21 at 9:12
  • i was trying to install optimized opencv for python in raspberry pi2.instructed from the following website pyimagesearch.com/2017/10/09/… when i run the command import cv2 in python it shows illegal instruction error.what to do? – Suhail Apr 21 at 11:29
  • 2
    The link is broken (error 404). Do yo expect that we follow all that instructions? And then? What should it help? That tutorial is for advanced Raspberry Pi users and is focused on optimizing OpenCV. You should use a plain installation first. – Ingo Apr 21 at 17:42
  • Welcome -- but Ingo's right: You are wasting your time with this. – goldilocks Apr 21 at 20:53

Your Answer

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

Browse other questions tagged or ask your own question.