Easiest way to install OpenCV for python in Raspberry pi within few minutes
ฝัง
- เผยแพร่เมื่อ 2 ต.ค. 2024
- In this video I will show you how to install OpenCV for python in the easiest way within few minutes.
Commands used in this video:
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100
sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
wget bootstrap.pypa...
sudo python3 get-pip.py
sudo pip3 install opencv-contrib-python
**Edit : While importing opencv if you get error like "ImportError: /usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8" ,then use
"sudo pip3 install opencv-contrib-python==3.4.6.27" - this command as the latest version of openCV doesn't work with RPi.
After this if you get "ImportError: libhdf5_serial.so.103: cannot open shared object file: No such file or directory" - this error then use the below command:
sudo apt-get install python3-h5py
For future updates follow us on facebook: / sparklers2018 - วิทยาศาสตร์และเทคโนโลยี
"Easiest way to install OpenCV for python in Raspberry pi within few minutes" The title deserves evrything bro........100000% working even installed in few minitues (
The first command didn't work for me, but this command replaced it well:
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103
I'm sorry, but mine said,
E:unable to locate package libhdf5-103.
So, what should I do ?
Check the message after executing the first line, if it failed then change the first line to "sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103" it will work.
I neglected the message at first and it didn't work.
Also fixed my install. Thank you Vishal and SPARKLERS!
@@billtrondsen same with me thanks
I'm sorry, but mine said,
E:unable to locate package libhdf5-103.
So, what should I do ?
"sudo pip3 install opencv-contrib-python==3.4.6.27"
This throws an error: No matching distribution found for opencv-contrib-python==3.4.6.27...
did anyone solve this probelm ?
work for me . thankyou very much.
but for last step im stuck for a long time with response
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: numpy>=1.14.5 in /usr/lib/python3/dist-packages (from opencv-contrib-python) (1.16.2)
Building wheels for collected packages: opencv-contrib-python
Building wheel for opencv-contrib-python (PEP 517)
and i solve with this
cancel and try this
"sudo pip3 install opencv-contrib-python==3.4.6.27"
hi i'm from Mexico (Saludos por cierto y buen video) if somebody got the issuse: " ImportError: libhdf5_serial.so.103: cannot open shared object file: No such file or directory" can try: "sudo apt install libhdf5-103" it work's for me :) regards! and nice video
did you solve this problem I have exactly the same
@@petercalderbank1788 just replace the first line with the line that I put in the comment above
@@antonioislasromero5539 Which Command? I also getting same error
Hey, I m getting an error "unable to locate package libjasper-dev while running "sudo apt-get install libjasper-dev". Can you tell ne how to resolve it?
Hey, I m getting an error "unable to locate package libjasper-dev while running "sudo apt-get install libjasper-dev". Can you tell ne how to resolve it? please help
THIS VIDEO WILL INSTALL OPEN CV on your RPI...just make sure to read the error messages and the edit in the description.
While importing opencv if you get error like "ImportError: /usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8" ,then use
"sudo pip3 install opencv-contrib-python==3.4.6.27" - this command as the latest version of openCV doesn't work with RPi currently.
After this if you get "ImportError: libhdf5_serial.so.103: cannot open shared object file: No such file or directory" - this error then use the below command:
sudo apt-get install python3-h5py
I have a problem,i still have the same error even after installing that version,can you please help me? I have opencv 4.1.1.26 and numpy 1.16.2
when i run this command say : " ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
opencv-contrib-python==3.4.6.27 from www.piwheels.org/simple/opencv-contrib-python/opencv_contrib_python-3.4.6.27-cp37-cp37m-linux_armv7l.whl#sha256=c2bc36033b23aa8fb989ffa1b4e96e8beae005bc527f486d2a32982b5ea41925:
Expected sha256 c2bc36033b23aa8fb989ffa1b4e96e8beae005bc527f486d2a32982b5ea41925
Got 8ae508287c0321a4682b6a7afa49484fc8eae042180d7a82c415e1b9f2a1a134 " . how i can solve this problem brother.
@@onisimrosu1396 try this tutorial. th-cam.com/video/H7k1YApU0pg/w-d-xo.html
@@onisimrosu1396 github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi/issues/67
go to that page and Ctrl+F to search for "Zach-Op". Follow his steps and you should be able to install OpenCV. The version 4 is not compatible with RPi according to some users.
@@IamG3X Thanks!
I'm trying to run the line "sudo pip3 install opencv-contrib-python" but I get the following error : "Could not find any downloads that satisfy the requirement opencv-contrib-python...." and then "No distributions at all found for opencv-contrib-python"
How can I fix it?
How would I got about getting this to work for python 2.7? Instructions worked perfectly for python 3.
I’ve tried like 100 descriptions to install it, this was the easiest and only working one. Thank you very much!!!
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
I get this error
mmmmmhwaaaa ndo livhuesa , thank you so much
'sudo' is not recognized as an internal or external command,
operable program or batch file.
pls help
thank you, finally a good guide.
Thank you so much. I was struggling for last 1 month to install opencv. Finally thru this video I was able to install successfully
awesome video! after countless videos of how to install opencv on pi zero w this is by far the best the others took HOURS.
because the other methods compile the library in the pi
can we see camera on rasperry-pi lite if we start the apllication
It works the best tutorial
Finalmente sò riuscito a caricà CV senza problemi....Grazie di cuore...!!!
Thank you! This was very helpful.
Goood and thank you i'll try to do same
I am trying to install it but in 1st command it shows me error that libhdf5-100 has no installation package
Try with libhdf5-103
libhdf5-100 "Unable to locate package" Please help
Hey friend, try this: change libhdf5-100 for libhdf5-103
@@fernandosaraiva672 nope doesn't work. thanks for the quick reply though
@@somebody9033 Update 14th April 2020. It works for me when I used
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103
and
sudo pip3 install opencv-contrib-python==3.4.6.27
with al the other lines of the script as initially marked
@@timmarkbaker doesn't work either, but thanks a lot for the very swift reply!
sudo apt-get install libhdf5-serial-dev
Super. Thank you.
HI every one . When i run the last command say to me: "Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from opencv-contrib-python) (1.16.2)" . And dose not work need help please
Try re-install it.
@@natebrownnz same with me
cancel and try this
sudo pip3 install opencv-contrib-python==3.4.6.27"
because latest version of openCV doesn't work with RPi.
Thanks alot!!
Saved me
Thanks!
Hello, excellent video!
I wanted to ask, what would be the minimum amount of RAM I need to run OpenCV. I'm planning on buying a raspberry pi 4 but I don't know if th 2GB will be enough for openCV object tracking :-/
Did u find the answer?
@@betulsahin5419 The 4 GB ram model seems to be enough for simple tasks
@@JARC99_ I appreciate for your return.
It is taking forever to install install opencv. like more than 5 hrs
please help me out guys.
Building wheels for collected packages: opencv-contrib-python
Building wheel for opencv-contrib-python (PEP 517) ... -
??? are you so ?
@@ihsanpratama2926 yes bro mine also stucked at this line...what should I do ......should I break the command
@@mohanamanikantarapolu6647 see my comment
@@mohanamanikantarapolu6647 Cancel amd try this "sudo pip3 install opencv-contrib-python==3.4.6.27"
@@ihsanpratama2926 thanks a lot its works fine
I am stuck in last command ......it is just running from more than 4 hours! why is it taking so long? should I cancel and re run the last command?
same with me "Building wheels for collected packages: opencv-contrib-python
Building wheel for opencv-contrib-python (PEP 517) ... -
" are you so ?
i solve the problem this way
cancel and try this
sudo pip3 install opencv-contrib-python==3.4.6.27"
because latest version of openCV doesn't work with RPi.
@@ihsanpratama2926 Thanks
@@ihsanpratama2926 Thank you :)
I get a hash mismatch error with the final command: 'sudo pip3 install opencv-contrib-python'.
Is there a workaround or solution?
Make sure you have a good internet connection and use sudo pip3 install --no-cache-dir opencv-contrib-python