1

OpenCV 2.1 was first installed when I had the original python 2.6 and this works fine. However after getting the Python 3.1, it has no module called 'cv' after trying to import OpenCV. How to add these modules?

3 Answers 3

0

According to this answer on StackOverflow, OpenCV doesn't support Python 3 and no one is working on Python 3 support either.

1
  • 1
    This is out of date.
    – hayd
    Aug 13, 2015 at 5:50
0

As of April 2019, you can install opencv for Python 2.7 and 3.4-3.7. It can be installed via pip for PythonV2 and pip3 for PythonV3:

pip3 install opencv-python
  • In case of installation problems you may need to upgrade your pip version (pip install --upgrade pip)
  • Despite the package name the module is still imported in Python using:

    import cv2
    

See https://pypi.org/project/opencv-python/ for details.

-3

Simply use import statement. First go to

$ cd /usr/local/lib/python2.6/site-packages/opencv

Then start python:

$ python
>>>  import cv.py

For any other help, refer http://blog.taesoo.org/?p=210 and http://opencv.willowgarage.com/documentation/python/introduction.html.

2
  • 1
    First of all, you don't need to be in any particular folder to import the cv package. Second of all, the OP was asking for Python 3 instructions, and you are talking about Python 2.6. There is a world of difference there.
    – GaRyu
    Jul 19, 2012 at 10:54
  • 1
    -1: this is just wrong Python coding and doesn't answer the question.
    – Timo
    Jul 19, 2012 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .