Install python-opencv module

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Install python-opencv module

5,181 Views
erikraynolds
Contributor III

Dears,

I got imx Yocto image with python & opencv installed. I'd like to use opencv within python so I need to include opencv module.

 

root@imx6qpsabreauto:/# python

Python 2.7.12 (default, Apr  7 2017, 11:56:02)

[GCC 6.2.0] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import cv2

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ImportError: No module named cv2

>>> 

II did try to isntall but with no success

root@imx6qpsabreauto:/# pip install opencv-python

Collecting opencv-python

  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8c29ea10>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python/

  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8c29e990>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python/

  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8c29e0d0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python/

  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8c29ebd0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python/

  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8c29ed50>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/opencv-python/

  Could not find a version that satisfies the requirement opencv-python (from versions: )

No matching distribution found for opencv-python

How do I install python-opencv module? I don't want to build the image again because of this.

Labels (1)
0 Kudos
2 Replies

2,920 Views
erikraynolds
Contributor III

sounds interesting .. but adding IMAGE_INSTALL_append += "opencv" is python-opncv module not added there must other trick to do it...

0 Kudos

2,920 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Erik Raynolds,

You may add the opencv module to your image by adding the following line to your local.conf file:

IMAGE_INSTALL_append += "opencv"

I understand you would prefer not to build the image again, however, if you already have built the image and just add a package all previously compiled packages remain so it should be much faster than the first time you baked the image.

If pip is installed on your image you may also use it to install modules. You may add pip by using the yocto packages python-pip or python3-pip depending on which version of python you are using but I’m afraid you would need to build the image to add it this way.

My apologies for the inconvenience. I hope this helps!

Regards,

0 Kudos