OBS: for those who are getting error: No module named 'cv2' I think it's because there is no python2 installed anymore in raspberry pi, therefore opencv will not be installed properly. Solution: After you run sudo make install run this command: sudo cp -R /usr/local/lib/python3.9/site-packages/cv2/ /usr/local/lib/python3.9/dist-packages/ Just check if you have the same python version otherwise just change it to your pythons version so for example if you have python3.7 installed change the python3.9 to python3.7. Let me know if this solve your problem.
cp: cannot stat '/usr/local/lib/python3.7/site-packages/cv2/': No such file or directory after running the command sudo -R/usr.. I am getting this error I am not able to creat cv2 folder manually also in the path : /usr/local/lib/python3.7/site-packages (getting message as permission denied) Please reply
@@SunilKumar-qo2nbrun this commend after you did everything in this video and if still there is not any folder called cv2 in /usr/local/lib/python3.7/site-packages so that means the opencv was not installed correctly and it can have many reason so I dont really know how to solve it. Otherwise you can install it from Pre-built Binaries by typing 'sudo apt-get install python3-opencv'.
Thank you! The compile process got stuck many times . It took more than 18hours for opencv to get installed( Rpi3b+, 1gb ram) I increased the swapsize to 4096. Kept GPU at 76. I used make -j4 command. Made sure that the board is well ventilated and not getting heated up. Also I used raspcontroller app to check if the download is still continuing or got stuck . I don't know if this makes sense, but it helped me. After 99% it took almost three hours to get the process completed.
Yo please help out at 63% it canceled and gave a long list of errors and whatnots but the main thing is [makefile:182: all] Error 2. Ive tried redoing the make command and that pip upgrade thing you said
Hello sir.. I am also getting the same error i.e. python3 import cv2 as cv ModuleNot FoundError: No module named 'cv2' I followed exactly the same steps as mentioned in your doc. Please help as soon as possible. I am using Raspberry Pi 4 Model B 8GB
Hello everyone, firstly thank you for your explanatory video. I've a problem about installation of openCV to my raspberry pi 4 model - b, Problems that program gave me : make[2]: *** [modules/dnn/CMakeFiles/opencv_perf_dnn.dir/build.make:230: bin/opencv_perf_dnn] Error 1 make[1]: *** [CMakeFiles/Makefile2:2238: modules/dnn/CMakeFiles/opencv_perf_dnn.dir/all] Error 2 make: *** [Makefile:182: all] Error 2 Are there anybody who have an idea to fix that problem, thanx
Sir I have a question, I follow every step and it seems to be okey however. At 99% of /Desktop/opencv/build/ $ make , my desktop totally freeze. Hope you can help me sir thank you
@@index-zero I tried, now the make operation does not work. it wtirtes" no targets specified and no makefile found" and "command not found" . can you help me?
@@index-zero I tried, now the make operation does not work. it wtirtes" no targets specified and no makefile found" and "command not found" . can you help me?
When I tape import cv2,I get this error RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.9/site-packages/cv2/__init__.py", line 8, in from .cv2 import * ImportError: numpy.core.multiarray failed to import how I can fix it
Please always mention Raspberry Pi specs. I know it is Pi 4, but the memory is really a big concern when it comes to compiling and installing opencv, that is, if your Pi has low memory i.e. 2GB the chances are that it will freeze at some point and won't be able to install opencv eventually. BTW, what are your specs? Also, what version of Raspbian have you installed 32-bit or 64bit?
I ´ve follow all the steps along with the video and I keep getting an error in the las step, when you go to python to check the installation : python3 import cv2 as cv ModuleNot FoundError: No module named 'cv2' do you know what is the problem? I am trying to instal in a raspberry pi3 model B+
Hey, I have installed opencv on my raspberry pi 3 , i can import opencv in terminal only but not in thonny python, if i try to run command import cv2 in thonny python, i'm getting this error " No module named cv2 " , Please help me resolve this problem
Did you try this: After you run sudo make install run this command: sudo cp -R /usr/local/lib/python3.9/site-packages/cv2/ /usr/local/lib/python3.9/dist-packages/ Just check if you have the same python version otherwise just change it to your pythons version so for example if you have python3.7 installed change the python3.9 to python3.7.
OBS: for those who are getting error: No module named 'cv2'
I think it's because there is no python2 installed anymore in raspberry pi, therefore opencv will not be installed properly.
Solution:
After you run sudo make install run this command: sudo cp -R /usr/local/lib/python3.9/site-packages/cv2/ /usr/local/lib/python3.9/dist-packages/
Just check if you have the same python version otherwise just change it to your pythons version so for example if you have python3.7 installed change the python3.9 to python3.7.
Let me know if this solve your problem.
cp: cannot stat '/usr/local/lib/python3.7/site-packages/cv2/': No such file or directory
after running the command sudo -R/usr.. I am getting this error
I am not able to creat cv2 folder manually also in the path : /usr/local/lib/python3.7/site-packages (getting message as permission denied)
Please reply
@@SunilKumar-qo2nbrun this commend after you did everything in this video and if still there is not any folder called cv2 in /usr/local/lib/python3.7/site-packages so that means the opencv was not installed correctly and it can have many reason so I dont really know how to solve it. Otherwise you can install it from Pre-built Binaries by typing 'sudo apt-get install python3-opencv'.
worked for me. Thank you
its work
That worked for me! Thanks Cheers! :)
Thank you!
The compile process got stuck many times . It took more than 18hours for opencv to get installed( Rpi3b+, 1gb ram)
I increased the swapsize to 4096.
Kept GPU at 76. I used make -j4 command.
Made sure that the board is well ventilated and not getting heated up.
Also I used raspcontroller app to check if the download is still continuing or got stuck .
I don't know if this makes sense, but it helped me.
After 99% it took almost three hours to get the process completed.
Yo please help out at 63% it canceled and gave a long list of errors and whatnots but the main thing is [makefile:182: all] Error 2. Ive tried redoing the make command and that pip upgrade thing you said
i am getting error in make command that no target is sepcified and no makefile found
Can it be install in Raspberry Pi 3 model B ram 1GB?
did u find some tutorial worked in rasp 3 model b?
thank you very much. but i spent 7 hours to install it. this is very long long time. it is not 2 3 hours . lmao
Hello sir.. I am also getting the same error i.e.
python3
import cv2 as cv
ModuleNot FoundError: No module named 'cv2'
I followed exactly the same steps as mentioned in your doc. Please help as soon as possible.
I am using Raspberry Pi 4 Model B 8GB
Same issue here...pleeeeease help.
Same issue
+1 plz help
I want to know how to install cvzone and tensorflow 2 on raspberry pi
Hello everyone, firstly thank you for your explanatory video. I've a problem about installation of openCV to my raspberry pi 4 model - b,
Problems that program gave me :
make[2]: *** [modules/dnn/CMakeFiles/opencv_perf_dnn.dir/build.make:230: bin/opencv_perf_dnn] Error 1
make[1]: *** [CMakeFiles/Makefile2:2238: modules/dnn/CMakeFiles/opencv_perf_dnn.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
Are there anybody who have an idea to fix that problem, thanx
Run that code again to fix. Same problem but worked for me
@@amritraj7640 I have run "make" again but the problem persists, do you have any other alternative solution?
can i do the same for the raspberry pi zero w?
Yeh I think it should work.
@Vector5284 had it worked with rasp pi Zero W ?
I keep getting cannot create directory 'build': File exists every time I input "cd ~opencv && mkdir build && cd build"
Sounds like you already created a build folder so just type 'cd opencv/build'.
Is the raspberry pi 3 work good with openCV or i need to buy tje raspberry pi 4 ?
Sir I have a question, I follow every step and it seems to be okey however. At 99% of /Desktop/opencv/build/ $ make , my desktop totally freeze. Hope you can help me sir thank you
Sorry but I really don't know what is the problem :-( .
Is okey sir thank you hehe
@@syakirpro1929 Did you fix the problem? I have the same one
Great video ❤❤
When i write cmake ../ i got ( command not found) what is the solution please?
did you get any answer?
check if you are creating the folder ("Build") inside the opencv directory or not
if not:
$ cd opencv
$ mkdir Build
$ cd Build
$ cmake ../
it took 4 hours for me in pi 4
Open CV 4 in raspberry Pi is that same method???
Please reply
Yes it is 🙂
really wonderful OpenCV video. Would the installation be the same for an Orange Pi 800? Thank you.
why when in "make" it stops at 98 percent only
did u find a solution, I'm having the same problem
@@mohalghaithi9873 me too
same afterv almost 11 hours
me too, any solution?
thank you very much!
Thank you!
"make" operation takes a lot of time.It's about 44 percent and it started 12 hours ago. what i suposed to do?
Try "make -j4", it will speed up the make process.
@@index-zero I tried, now the make operation does not work. it wtirtes" no targets specified and no makefile found" and "command not found" . can you help me?
@@index-zero I tried, now the make operation does not work. it wtirtes" no targets specified and no makefile found" and "command not found" . can you help me?
@@roni1422 you have to run this command when you are in build folder, so when you are in opencv folder run cd build then run the make -j4
@@index-zero The raspberry stucks at 90% when I use make-j4. do you know what can I do?
i am getting this error how can i fix it
(bash: cd: too many arguments)
When you are getting this error?
@@index-zero mkdir build
Sorry I'm not sure why you are getting this error.
Thank you very much
thank you so much...
What OS are you using?
Windows
@@index-zero Do you use raspberry Pi OS Lite(Legacy) or raspberry Pi OS (Legacy)?
thank you
thanks you, i did yet
When I tape import cv2,I get this error
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/.local/lib/python3.9/site-packages/cv2/__init__.py", line 8, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
how I can fix it
Did you run this command 'sudo apt-get install python3-dev python3-numpy'? Also try this command "pip install numpy --upgrade"
@@index-zero I love you
I did it in the terminal and worked for me but when i do it in thonny i still have the same problem pls help and reply
Please always mention Raspberry Pi specs. I know it is Pi 4, but the memory is really a big concern when it comes to compiling and installing opencv, that is, if your Pi has low memory i.e. 2GB the chances are that it will freeze at some point and won't be able to install opencv eventually. BTW, what are your specs? Also, what version of Raspbian have you installed 32-bit or 64bit?
Yeh you are right I had to mention it thank that you pointed it out.
I have a Raspberry Pi 4 - 4GB, and also have installed a 32-bit Raspbian.
the documentation says that it is for ubuntu .... 64bit
how did it work with you with 32 bit?
I ´ve follow all the steps along with the video and I keep getting an error in the las step, when you go to python to check the installation :
python3
import cv2 as cv
ModuleNot FoundError: No module named 'cv2'
do you know what is the problem? I am trying to instal in a raspberry pi3 model B+
Did you install with sudo?
Hi same issue as well! After sudo make install, i went to check it mention similar error as well
Somehow issue is resolved when i ran sudo apt-get install python3-opencv
Hey, I have installed opencv on my raspberry pi 3 , i can import opencv in terminal only but not in thonny python, if i try to run command import cv2 in thonny python, i'm getting this error " No module named cv2 " ,
Please help me resolve this problem
I have tried in my raspberry pi 4 and it works just fine so I dont know what is exactly the problem.
I followed all of the instructions as it is .. but still to not working
Did you try this:
After you run sudo make install run this command: sudo cp -R /usr/local/lib/python3.9/site-packages/cv2/ /usr/local/lib/python3.9/dist-packages/
Just check if you have the same python version otherwise just change it to your pythons version so for example if you have python3.7 installed change the python3.9 to python3.7.
successfully install in raspbarian os