I referred below link to solve the error of "no module Named cv2":

https://qengineering.eu/install-opencv-4.4-on-raspberry-pi-4.html

I copied manually the cv2 as suggested by the above link as below:

For Python 2: $ cd ~/opencv/build/lib/ $ sudo cp cv2.so /usr/local/lib/python2.7/dist-packages/cv2/python-2.7 For Python 3: $ cd ~/opencv/build/lib/python3 $ sudo cp cv2.cpython-37m-arm-linux-gnueabihf.so \ /usr/local/lib/python3.7/dist-packages/cv2/python-3.7 Ensure that you create cv2 dir first if you got error.

Answer from user14848773 on Stack Overflow
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
sudo python3 No module named 'cv2' - Raspberry Pi Forums
ImportError: No module named 'cv2' i have been searching alot but with no luck. any help PLEASE! ... You probably installed the cv module locally (just for user pi). If you used pip / pip3 you have to install it globally with 'sudo' e.g. ... pi@raspberrypi:~ $ sudo pip3 install opencv-python ...
Discussions

Raspberry PI 4 - ModuleNotFoundError: No module named 'cv2' Error at Boot
Hi all, I need help! I create an Object Detection Project on a Raspberry PI 4. When I start the potato_classify.py Script manually, everything works fine. The final step is too start the potato_classify.py Script when the Raspberry PI boots. Therefore I created the following crontab: # Edit ... More on forum.edgeimpulse.com
🌐 forum.edgeimpulse.com
0
0
June 24, 2021
linux - python cv2 module not found when triggered by crontab - Raspberry Pi Stack Exchange
My python script imports cv2, and it works fine when I start the script manually. If I set the script to launch on boot (either via crontab, or via a .desktop file (in the user/.config/autostart/wh... More on raspberrypi.stackexchange.com
🌐 raspberrypi.stackexchange.com
September 12, 2022
python - Cannot find module cv2 when using OpenCV - Stack Overflow
I have installed OpenCV on the Occidentalis operating system (a variant of Raspbian) on a Raspberry Pi, using this script by jayrambhia. It installed version 2.4.5. When I try import cv2 in a Python More on stackoverflow.com
🌐 stackoverflow.com
ModuleNotFoundError: No module named 'cv2.cv'; 'cv2' is not a package - Raspberry Pi Forums
pi@raspberrypi:~/Desktop $ python3 track.py Traceback (most recent call last): File "track.py", line 7, in import cv2.cv as cv ModuleNotFoundError: No module named 'cv2.cv'; 'cv2' is not a package please help asap More on raspberrypi.org
🌐 raspberrypi.org
October 8, 2019
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
ModuleNotFoundError: No module named 'cv2'ModuleNotFoundError: No module named 'cv2' - Raspberry Pi Forums
February 13, 2024 - Are you managing MAIN.PY inside a Virtual Environment as MU seems to recommend? If so, you have to activate the VENV before you can run MAIN.PY with just PYTHON. CV2 would only be accessible inside the VENV.
🌐
Edge Impulse Forum
forum.edgeimpulse.com › help
Raspberry PI 4 - ModuleNotFoundError: No module named 'cv2' Error at Boot - Help - Edge Impulse Forum
June 24, 2021 - Hi all, I need help! I create an Object Detection Project on a Raspberry PI 4. When I start the potato_classify.py Script manually, everything works fine. The final step is too start the potato_classify.py Script when the Raspberry PI boots. Therefore I created the following crontab: # Edit ...
🌐
Quora
quora.com › How-do-you-overcome-this-if-you-get-an-error-like-no-module-cv2-in-Raspberry-Pi
How to overcome this if you get an error like no module cv2 in Raspberry Pi - Quora
Answer (1 of 3): Raspberry pi has pre compiled opencv modules. For python3 to detect cv2 follow the below steps 1. pip3 install opencv-python 2. sudo apt-get install libqt-test 3. sudo apt-get install libatlas-base-dev 4. sudo apt-get install libjasper-dev 5. sudo apt-get install libqtgui4 This...
Top answer
1 of 2
1

If you install as a user ONLY that user has access.

Install with sudo.

Frankly installing with pip is a poor practice use sudo apt install python3-opencv to install the version in the repository.

2 of 2
0

Encountering the same question. Been trying to start a python script automatically every time the Raspberry Pi activated, tried every possible way(rc.local, bashrc, crontab and other ways), finally realize that the bashrc and crontab is the most suitable way for my utility.

But both ways return the same Error: Traceback (most recent call last): File "/home/fanshaoqi/chi/plant_phenotyping/Get_Plant_Architecture/0_Main_Script.py", line 2, in import CameraDistance File "/home/fanshaoqi/chi/plant_phenotyping/Get_Plant_Architecture/CameraDistance.py", line 1, in import cv2 ModuleNotFoundError: No module named 'cv2'

This is my .bashrc content: echo Running at boot sudo /usr/bin/python3 /home/fanshaoqi/chi/plant_phenotyping/Get_Plant_Architecture/0_Main_Script.py

This is my crontab content: PYTHONPATH=/home/fanshaoqi/.local/lib/python3.9/site-packages/cv2 LANG=nb_NO.UTF-8 LC_ALL=nb_NO.UTF-8 @reboot sudo /usr/bin/python3 /home/fanshaoqi/chi/plant_phenotyping/Get_Plant_Architecture/0_Main_Script.py

My Raspberry Pi information: fanshaoqi@raspberrypi:~ $ uname -a Linux raspberrypi 6.1.52-v8+ #1679 SMP PREEMPT Fri Sep 8 14:46:04 BST 2023 aarch64 GNU/Linux

fanshaoqi@raspberrypi:~ $ cat /proc/device-tree/model Raspberry Pi 4 Model B Rev 1.4

Pls can someone help me, been stuggling for days... Thank you!

🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
ModuleNotFoundError: No module named 'cv2.cv'; 'cv2' is not a package - Raspberry Pi Forums
all I can say is importing cv2.cv worked only on a pi with older opencv on python2 Newer versions, including an ubuntu laptop gave the same error. You probably need to either find same methods in other cv2 modules or find a newer example code with same functionality. ... $ python2 Python 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> cv2.cv <module 'cv2.cv' (built-in)> >>> from cv2 import cv >>> cv2.__version__ '2.4.9.1' >>> PS e.g.
Find elsewhere
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
No module named 'cv2' after update. - Raspberry Pi Forums
pi@raspberrypi:~ $ python3 BASE.PY Traceback (most recent call last): File "BASE.PY", line 1, in <module> import cv2 ModuleNotFoundError: No module named 'cv2' The same problem on RPI3 and RPI4. It still works perfectly on the RPI with previous versions.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
Unable to import cv2 on OpenCV installation - Raspberry Pi Forums
mkdir myenv cd myenv python -m venv env source env/bin/activate pip install opencv-python In Thonny, click Run, Configure Interpreter, then for "Python Executable", click 3 dots and select Home myenv env bin python3.11 , click OK OK Now in Thonny repl (lower screen) we can import cv2 with no error: ... Sorry about the delay. I've been working hard on my end trying to figure out what the problem is. I have installed virtualenv but when I call ... /usr/bin/python: No module named venv So B.Goode, I did follow along with your steps exactly but it failed at the point indicated.
🌐
GitHub
github.com › opencv › opencv › issues › 21359
OpenCV 4.5.5: No module named cv2 - wrong Python 3 install path on Raspberry Pi OS Bullseye · Issue #21359 · opencv/opencv
On Raspberry Pi OS Bullseye (32-bit), OpenCV 4.5.5 Python 3 packages are installed to lib/python3.9/site-packages/cv2/python-3.9 instead of lib/python3.9/dist-packages/cv2/python-3.9. Issue happened since OpenCV 4.5.5.
Author   opencv
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
No Module named cv2 - Raspberry Pi Forums
Hi, I have written a simple program 'imgprop.py' and when I run the program, I get following error pi@raspberrypi:~ $ python3 imgprop.py Traceback (most recent call last): File "imgprop.py", line 1, in <module> import cv2 ImportError: No module named 'cv2' I tried to resolve this problem by ...
🌐
GitHub
github.com › EdjeElectronics › TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi › issues › 21
import cv2 ModuleNotFoundError: No module named 'cv2' · Issue #21 · EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi
(tensorflow-build) C:\tensorflow-build>python TFLite_detection_webcam.py --modeldir=C:\tensorflow\models\research\object_detection\coco_ssd_mobilenet_v1_1.0_quant_2018_06_29 Traceback (most recent call last): File "TFLite_detection_webcam.py", line 19, in import cv2 ModuleNotFoundError: No module named 'cv2'
Author   EdjeElectronics
🌐
Edureka Community
edureka.co › home › community › categories › python › modulenotfounderror no module named cv2
modulenotfounderror no module named cv2 | Edureka Community
February 8, 2022 - Cannot find module cv2 when using OpenCV I have successfully downloaded the OpenCV on the Occidentalis ... this please as I am new to Linux?
🌐
Super User
superuser.com › questions › 1482154 › raspbian-openvino-no-module-named-cv2
python - Raspbian openVINO - no module named 'cv2' - Super User
September 13, 2019 - 01 pi@raspberrypi:~/build $ python3 02 Python 3.7.3 (default, Apr 3 2019, 05:39:12) 03 [GCC 8.2.0] on linux 04 Type "help", "copyright", "credits" or "license" for more information. 05 >>> import cv2 06 Traceback (most recent call last): 07 File "<stdin>", line 1, in <module> 08 ModuleNotFoundError: No module named 'cv2' 09 >>> 10 [1]+ Stopped python3
🌐
PyPI
pypi.org › project › opencv-python
opencv-python · PyPI
cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml") ... Before opening a new issue, read the FAQ below and have a look at the other issues which are already open. ... A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries. Q: Pip install fails with ModuleNotFoundError: No module named ...
      » pip install opencv-python
    
Published   Feb 05, 2026
Version   4.13.0.92
🌐
GitHub
github.com › raspberrypi › bookworm-feedback › issues › 420
Missing requirement for preinstalled picamera2 package (OpenCV) · Issue #420 · raspberrypi/bookworm-feedback
June 6, 2025 - I did fresh install of Raspberri Pi OS (64 bit) 2025-05-13 using the Raspberry Pi Imager. I get the following error when running a python script to take pictures using picamera2 Traceback (most recent call last): File "/home/pi/pi.py", l...
Author   raspberrypi
🌐
Adeept
adeept.com › forum › thread-852-1-1.html
Adeept - Forum - No module named 'cv2'
Adeept»Forum › Raspberry Pi › Smart Car Kits & Robots &rsaquo; No module named 'cv2'