Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5104

Python • ModuleNotFoundError: No module named 'cv2'ModuleNotFoundError: No module named 'cv2'

$
0
0
I am new to python
I am trying to start python3 /home/pi/mu_code/Main.py at boot using .bashrc..It does not load but when I open the command window I see:
Running at boot
Traceback (most recent call last):
File "/home/pi/mu_code/Main.py", line 3, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'

Main.py runs fine in the mu ide so cv2 is installed
thinking I needed to start cv2 from /home/pi/mu_code/
I added import os
then os.chdir('/home/pi/mu_code') at line three in Main.py and rebooted
It still did not run and I received this in the command window
Traceback (most recent call last):
File "/home/pi/mu_code/Main.py", line 5, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
I am running it on a pi 3
with 32 bit pi OS
searching this forum and the web were no help.
Any solution would be greatfully appreciated.

Statistics: Posted by Marineman — Tue Feb 13, 2024 10:07 am — Replies 1 — Views 32



Viewing all articles
Browse latest Browse all 5104