Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Can't import cv2

Hi

root@edison:~# cat /etc/version
201603141535

I'm looking at "Getting Started with Intel Edison"
page 27

at the Edison/Linux command prompt I entered the following:

root@edison:~# python
Python 2.7.3 (default, Mar 8 2016, 11:28:40)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import mraa

>>> import cv2
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named cv2
>>>

>>> import CV2
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named CV2

Question: what do I have to do to install cv2 on Edison?

Regards,
Bill Fosbury
1 person has
this question
+1
Reply
  • Hi Bill,

    The line above that example on page 127 is the one that installs OpenCV -

    opkg install python-opencv

    You will need to install it before you can use that import statement.

    Best regards,
    Chris Olson
    O'Reilly Customer Service
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Hi Chris,

    I apologize for not giving you all of the details.

    I did do the : opkg install python-opencv
    and got this result:

    ~# opkg install python-opencv
    Unknown package 'python-opencv'.
    Collected errors:
    * opkg_install_cmd: Cannot install package python-opencv.

    I then confirmed that WIFi was working.

    Then:

    # opkg update
    Downloading http://iotdk.intel.com/repos/3.0/inte....
    Updated list of available packages in /var/lib/opkg/iotkit.

    Then:

    root@edison:/media/sdcard/opkg# opkg list | grep opencv

    Nothing showed up.

    Then:

    # ping opencv.org
    PING opencv.org (108.59.4.77): 56 data bytes
    64 bytes from 108.59.4.77: seq=0 ttl=57 time=22.484 ms
    64 bytes from 108.59.4.77: seq=1 ttl=57 time=23.390 ms
    64 bytes from 108.59.4.77: seq=2 ttl=57 time=23.720 ms
    ^C
    --- opencv.org ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 22.484/23.198/23.720 ms

    Question: might opencv have moved to some other "repository"?

    Regards,
    Bill
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned