Skip to content

import imutils error in Debian #7

Closed

Description

@tinashemudavanhu

Hi Jrose,

I am trying to import imutils in Debian distro running on BeagleBone Black. This is what im getting when i import it in the Python Interpreter;
root@beaglebone:~# python
Python 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import imutils
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/imutils/init.py", line 5, in
from .convenience import translate
File "/usr/local/lib/python2.7/dist-packages/imutils/convenience.py", line 108, in
def url_to_image(url, readFlag=cv2.IMREAD_COLOR):
AttributeError: 'module' object has no attribute 'IMREAD_COLOR'

How can i rectify the problem?

Activity

  1. jrosebr1 commented on Mar 7, 2016

    @jrosebr1
    Contributor

    the IMREAD_COLOR is part of the cv2 module which are your OpenCV bindings. Which OpenCV version are you using? I've seen errors like this happen when you install OpenCV via apt-get instead of compiling via source.

    Run:

    $ python
    >>> import cv2
    >>> cv2.__version___

    And then report back your version.

  2. tinashemudavanhu commented on Mar 7, 2016

    @tinashemudavanhu
    Author

    This is the kernel version i am operating on;
    root@beaglebone:~# uname -a
    Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l
    GNU/Linux

    See below for the cv2 version running on the system;

    root@beaglebone:~# python
    Python 2.7.3 (default, Mar 14 2014, 17:55:54)
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.

    import cv2
    cv2.version
    '$Rev: 4557 $'

    On Mon, Mar 7, 2016 at 1:26 PM, Adrian Rosebrock notifications@github.com
    wrote:

    the IMREAD_COLOR is part of the cv2 module which are your OpenCV
    bindings. Which OpenCV version are you using? I've seen errors like this
    happen when you install OpenCV via apt-get instead of compiling via
    source.

    Run:

    $ python

    import cv2
    cv2.version_

    And then report back your version.

    —
    Reply to this email directly or view it on GitHub
    #7 (comment).

  3. jrosebr1 commented on Mar 7, 2016

    @jrosebr1
    Contributor

    It sounds like you installed OpenCV via apt-get, which normally installs an out-dated version with functionality missing. I would suggest installing OpenCV from source to avoid this issue. The instructions listed below can be used to install OpenCV from source for Debian:

    http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/

    I'm going to go ahead and close this issue now. Re-flash Debian onto your BeagleBone Black and then compile OpenCV from source and it should take care of the issue. Otherwise, it might be a BBB issue, and since I do not have one, I cannot further diagnose the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions