Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what's cv2 and how to install it (i had run 'pip install cv2 --user') ? #3

Open
andyyuan78 opened this issue Mar 2, 2016 · 43 comments

Comments

@andyyuan78
Copy link

envy@ub1404:~/os_pri/github/video_to_sequence$ python download_videos.py
Traceback (most recent call last):
File "download_videos.py", line 6, in
import cv2
ImportError: No module named cv2

envy@ub1404:~/os_pri/github/video_to_sequence$ pip show cv2

Name: cv2
Version: 1.0
Location: /home/envy/.local/lib/python2.7/site-packages
Requires:
envy@ub1404:/os_pri/github/video_to_sequence$ python download_videos.py
Traceback (most recent call last):
File "download_videos.py", line 6, in
import cv2
ImportError: No module named cv2
envy@ub1404:
/os_pri/github/video_to_sequence$

@jazzsaxmafia
Copy link
Owner

It is OpenCV
you can install it by
pip install opencv

but I recommend installing it from source, as the python binary may not have video processing module in it.
http://opencv.org/

@andyyuan78
Copy link
Author

after run
suod apt-get install python-opencv
it passed, but new trouble come:

envy@ub1404:/os_pri/github/video_to_sequence$ python download_videos.py
Traceback (most recent call last):
File "download_videos.py", line 3, in
import pandas as pd
File "/home/envy/.local/lib/python2.7/site-packages/pandas/init.py", line 7, in
from pandas import hashtable, tslib, lib
File "pandas/src/numpy.pxd", line 157, in init pandas.hashtable (pandas/hashtable.c:38262)
ValueError: numpy.dtype has the wrong size, try recompiling
envy@ub1404:
/os_pri/github/video_to_sequence$

would you like show me the result of 'pip list'?

@andyyuan78
Copy link
Author

fix by reinstall pandas

@mshayeb
Copy link

mshayeb commented Feb 3, 2017

this works for me:

pip install opencv-python

@700brains
Copy link

failed on window

C:>pip install opencv-python
Collecting opencv
Could not find a version that satisfies the
)
No matching distribution found for opencv

@andythewhale
Copy link

@mshayeb why does that work?

@mshayeb
Copy link

mshayeb commented Apr 22, 2017

check the the version of your python, if you are using python 3 sometimes you have to call pip3

pip3 install opencv-python

make sure you are using python3 and not python 2 in run

@n4nagappan
Copy link

On ubuntu

sudo apt-get install python-opencv
pip install opencv-python

@prabinzz
Copy link

prabinzz commented Jun 4, 2017

pip3 install opencv-python

installs opencv3 what if i want v2 ???

@ghost
Copy link

ghost commented Jun 17, 2017

"pip3.6 install opencv" gives back error message:
No matching distribution found for opencv

@MCSH
Copy link

MCSH commented Jun 18, 2017

@prabinzz
you have to give pip a version, like this:
pip install opencv-python=={version}

@prashantmore123
Copy link

Install opencv-python instead of cv2.
pip install opencv-python

@root-sudip
Copy link

for python3.5, You can do by using this command => sudo pip3 install opencv-python

@harshit0511
Copy link

"pip install opencv-python"
works fine on mac os (y)

@Tianhuanyu
Copy link

ensure you have installed numpy and scipy
then "pip install opencv-python"
or"pip install opencv-python==version"
for u can use source of ustc "pip install opencv-python -i http://pypi.mirrors.ustc.edu.cn/simple"

@SaiKiranMukka
Copy link

this works for me
"pip3 install opencv-python"

@jatinmittal199510
Copy link

what @n4nagappan has given, worked for me. Thanks a lot. :)

@biplobb
Copy link

biplobb commented Feb 8, 2018

In web2py ,opencv version is 2.But in my local machine opencv version 3.2.ORB_create() is supported in my local machine.But in web2py ORB_create() is not supported . Can you give me any solution?Thanks in advance.

@Estapraq
Copy link

I have window10 and Python3.6. I did
pip install panda
pip install opencv-python

worked!

@gsum
Copy link

gsum commented Feb 22, 2018

for ubuntu 16.04
pip3 install opencv-python //does not work
pip install opencv-python //works for me

@Matrixsun
Copy link

if you use ananconda , you can install opencv by conda:
conda install opencv

@black0017
Copy link

If you have multiple versions of python on linux :

python2 -m pip install opencv-python # python2.x
python3.5 -m pip install opencv-python #python3.5
python3.6 -m pip install opencv-python #python3.6

add --user in the end if you have permission issues.

@eliethesaiyan
Copy link

you might also install pip install opencv_contrib-python as some module are missing in opencv

@zaheerkhancs
Copy link

pip3 install opencv-python

it worked for me.
screenshot from 2018-07-04 09-30-50

@adriendomoison
Copy link

adriendomoison commented Jul 6, 2018

If you've been like me starting to install everything after June 27th 2018, make sure you are not using Python 3.7. Otherwise you'll get the error since this version is not supported yet by OpenCV

Collecting opencv-python
  Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python

@aamirmalik
Copy link

@adriendomoison thanks a lot for this information! I was able to make opencv-python work with python2.7 - just sticking with that for now.

BTW is there a Python3 version you know which supports opencv-python?

@adriendomoison
Copy link

@aamirmalik OpenCV 3 works with Python 2.7, 3.4, 3.5 and 3.6. 👍

@kamarajuPrathi
Copy link

@adriendomoison does it work for python 3.7 ?

@adriendomoison
Copy link

@kamarajuPrathi no, not at the moment sadly

@ramneek029
Copy link

ramneek029 commented Oct 4, 2018

If you've been like me starting to install everything after June 27th 2018, make sure you are not using Python 3.7. Otherwise you'll get the error since this version is not supported yet by OpenCV

Collecting opencv-python
  Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python

is there some solution for that ??

@aaaisha
Copy link

aaaisha commented Dec 24, 2018

i want install cv2 not cv3 please can anyone tell me the correct command?

@itsthejoker
Copy link

@aaaisha pip install opencv-python, assuming you're in a virtualenv.

@Mega-Touk
Copy link

Mega-Touk commented Jan 10, 2019

running this under raspberry pi wont work because of opencv-python not beeing compiled for ARM on official repo, you first need to follow https://www.piwheels.org then it will be okay to pip install opencv-python

@belmarca
Copy link

belmarca commented Feb 1, 2019

Same error for me using pip 19.0.1.

$ python --version                                  
Python 3.6.6
$ pip install opencv-python-headless                
Collecting opencv-python-headless
  Could not find a version that satisfies the requirement opencv-python-headless (from versions: )
No matching distribution found for opencv-python-headless

@sahil-motwani
Copy link

"pip install opencv-python"
works fine on mac os (y)

cvtColor function is present in opencv-python?
if not than what should I use to get my work done

@despirit
Copy link

"pip3.6 install opencv" gives back error message:
No matching distribution found for opencv

I use windows 10
on command prompt
python -m pip install opencv-python

@TomYule
Copy link

TomYule commented Nov 14, 2019

pip3 install opencv-python pip install opencv-python
Collecting opencv-python
Could not find a version that satisfies the requirement opencv-python (from versions: )
No matching distribution found for opencv-python

I use mac os 10.14.5
python 3.8

I found a lot of information to solve the problem

brew tap brewsci/bio
brew tap brewsci/science
brew install opencv

Source
https://www.codingforentrepreneurs.com/blog/install-opencv-3-for-python-on-mac/

@rahul-moorkoth
Copy link

rahul-moorkoth commented Nov 26, 2019

This worked for me.

pip install opencv-contrib-python

@krunal704
Copy link

Not able to install OpenCV 4.1 using pip3 install opencv-python or sudo apt-get install python3-opencv

@deveshwaripujari
Copy link

Install opencv-python instead of cv2.
pip install opencv-python

WHY ???

@vesko-vujovic
Copy link

vesko-vujovic commented Sep 2, 2020

I had a problem with opencv, even if i installed everything inside my conda env I couldn't import cv2 module. I was getting the error "module not found".
What i did i removed pandas with pip unistall and conda remove after that i installed pandas and open cv with sudo pip3 intstall **.

Hope it helps.

@mkuangdotcom
Copy link

pip3 install opencv-python pip install opencv-python Collecting opencv-python Could not find a version that satisfies the requirement opencv-python (from versions: ) No matching distribution found for opencv-python

I use mac os 10.14.5 python 3.8

I found a lot of information to solve the problem

brew tap brewsci/bio
brew tap brewsci/science
brew install opencv

Source https://www.codingforentrepreneurs.com/blog/install-opencv-3-for-python-on-mac/

MacOS 13.1
Python 3.11.4

Works for me too

@mkuangdotcom
Copy link

i want install cv2 not cv3 please can anyone tell me the correct command?

Try this guide:

https://gist.github.com/innat/4af8e9a3accfdcf2511ee4ced26a1d77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests