video_to_sequence icon indicating copy to clipboard operation
video_to_sequence copied to clipboard

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

Open andyyuan78 opened this issue 8 years ago • 43 comments

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$

andyyuan78 avatar Mar 02 '16 15:03 andyyuan78

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/

jazzsaxmafia avatar Mar 04 '16 02:03 jazzsaxmafia

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 avatar Mar 05 '16 05:03 andyyuan78

fix by reinstall pandas

andyyuan78 avatar Mar 12 '16 09:03 andyyuan78

this works for me:

pip install opencv-python

mshayeb avatar Feb 03 '17 22:02 mshayeb

failed on window

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

700brains avatar Mar 22 '17 08:03 700brains

@mshayeb why does that work?

andythewhale avatar Apr 22 '17 21:04 andythewhale

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

mshayeb avatar Apr 22 '17 22:04 mshayeb

On ubuntu

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

n4nagappan avatar May 26 '17 14:05 n4nagappan

pip3 install opencv-python

installs opencv3 what if i want v2 ???

prabinzz avatar Jun 04 '17 11:06 prabinzz

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

ghost avatar Jun 17 '17 19:06 ghost

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

MCSH avatar Jun 18 '17 07:06 MCSH

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

prashantmore123 avatar Jul 12 '17 06:07 prashantmore123

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

root-sudip avatar Jul 28 '17 15:07 root-sudip

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

harshit0511 avatar Oct 18 '17 00:10 harshit0511

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"

Tianhuanyu avatar Nov 06 '17 04:11 Tianhuanyu

this works for me "pip3 install opencv-python"

SaiKiranMukka avatar Nov 15 '17 04:11 SaiKiranMukka

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

jatinmittal199510 avatar Nov 15 '17 18:11 jatinmittal199510

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.

biplobb avatar Feb 08 '18 17:02 biplobb

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

worked!

Estapraq avatar Feb 21 '18 16:02 Estapraq

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

gsum avatar Feb 22 '18 01:02 gsum

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

Matrixsun avatar Mar 18 '18 13:03 Matrixsun

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.

black0017 avatar Mar 29 '18 08:03 black0017

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

eliethesaiyan avatar Jun 13 '18 09:06 eliethesaiyan

pip3 install opencv-python

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

zaheerkhancs avatar Jul 04 '18 13:07 zaheerkhancs

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

adriendomoison avatar Jul 06 '18 21:07 adriendomoison

@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?

aamirmalik avatar Jul 08 '18 14:07 aamirmalik

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

adriendomoison avatar Jul 08 '18 22:07 adriendomoison

@adriendomoison does it work for python 3.7 ?

kamarajuPrathi avatar Jul 19 '18 22:07 kamarajuPrathi

@kamarajuPrathi no, not at the moment sadly

adriendomoison avatar Jul 20 '18 05:07 adriendomoison

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 ??

ramneek029 avatar Oct 04 '18 18:10 ramneek029