How to install OpenCV for python3 in Ubuntu

0 votes

I want to install OpenCV for python3 in ubuntu 16.04. Fist I tried running sudo apt-get install python3-opencv which is how I pretty much install all of my python software. This could not find a repository. 

The install does work however if I do sudo apt-get install python-opencv this issue with this is that by not adding the three to python it installs for python 2 which I do not use. I would really perfer not to have to build and install from source so is there a way I can get a repository?

 I also tried installing it with pip3 and it could not find it either.

Nov 28, 2018 in Python by Anirudh
• 2,080 points
2,575 views

1 answer to this question.

0 votes

I found this:

https://pypi.python.org/pypi/opencv-python

OpenCV on wheels

'Unofficial OpenCV packages for Python.'

Installation was painless for Ubuntu 16.04

pip3 install opencv-python

Check the installation

python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'

Not sure why this wasn't mentioned. Perhaps it is newly available?

answered Nov 28, 2018 by Nymeria
• 3,560 points

Related Questions In Python

0 votes
1 answer

How to install OpenCV for Python 2.7?

The official OpenCV installer does not install ...READ MORE

answered Nov 14, 2018 in Python by SDeb
• 13,300 points
1,931 views
0 votes
1 answer
0 votes
1 answer

How to Install pip for python 3.7 on Ubuntu 18?

The command you're looking for is: python3.7 -m ...READ MORE

answered Nov 20, 2020 in Python by Gitika
• 65,910 points
8,878 views
0 votes
1 answer

Raw_input method is not working in python3. How to use it?

raw_input is not supported anymore in python3. ...READ MORE

answered May 5, 2018 in Python by aayushi
• 750 points
3,071 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,023 views
0 votes
1 answer
+1 vote
10 answers

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,560 points
406,172 views
0 votes
1 answer

How to write inline if statement for print in Python?

Inline if-else expression must always contain the else ...READ MORE

answered Dec 4, 2018 in Python by Nymeria
• 3,560 points

edited Dec 6, 2018 by Nymeria 16,413 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP