Install the python version of opencv in the Raspberry Pi

1. Check pip and python version

# If the pip version is too low, it may not be installed and needs to be upgraded. Enter in the terminal
pip install -U pip

2. Install the dynamic link library that opencv depends on

# Terminal input
sudo apt install libqt4-test
sudo apt install libqtgui4

3. There is a problem

During the above command process, the following errors may occur:

4. Solution

# First step
cd /var/lib/dpkg
# Second step
sudo mv info info.baksudo
# third step
sudo mkdir info

5. Installation

# Terminal input
sudo pip install opencv-python

Success interface:

6. Test

# Terminal input
# Import
import cv2 as cv

The renderings are as follows:


Leave a Reply

Your email address will not be published.