opencv error in Raspberrypi

Asked 2 years ago, Updated 2 years ago, 74 views

I'm a complete beginner.

I use Raspberry 3 model B+, Raspbian, and Thonny (Simple Mode).

I installed Opencv (2.4.9.1) on LXTerminal, but it was installed on python2.
How can Python 3 handle Opencv?

The version was Python 2.7.13, Python 3.5.3.

US>Installation Commands
sudo apt-get upgrade
sudo apt-get python-opencv
sudo apt-get libopencv-dev

No module named 'cv2'
if Python 3 is import cv2 If I did import cv2 on Python 2, I could do it without any problems.

python opencv raspberry-pi

2022-09-30 17:30

1 Answers

Raspberry Pi's Python default is 2.x series, so if you install python series with apt-get, you'll get the default 2.x series. I guess Python 3 was included by default or apt-get. I think it's easier to include python 3's pip, which is Python's package controller.

$sudo apt-get install python3-pip
$ sudo pip3 install opencv-python


2022-09-30 17:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.