English 中文(简体)
Install Opencv in Yocto
原标题:Install Opencv in Yocto

I am new to Yocto project. I am using SAM9X60-EK as my target, and I want to add opencv to my image. I noticed that there is opencv included with meta-oe but when I add IMAGE_INSTALL:append = " opencv" to my core-image-sato.bbaappend file it gives me error, so I decided to write a recipee to download and install from source distribution.

我已把必要的扶养安排如下:

IMAGE_INSTALL:append = " python3"
IMAGE_INSTALL:append = " python3-pip"
IMAGE_INSTALL:append = " python3-numpy"
IMAGE_INSTALL:append = " opencv"

页: 1


SRC_URI = "file://opencv-python-4.8.0.76.tar.gz"

S = "${WORKDIR}"

 

# Add Python as a dependency

DEPENDS += "python3 cmake python3-pip"

 

do_unpack() {

    tar -xvf ${FILE_DIRNAME}/opencv-python-4.8.0.76.tar.gz -C ${S}

}

 

do_install() {

    install -d ${D}${bindir}

    cp -r ${S}/opencv-python-4.8.0.76/* ${D}${bindir}

   

    # Run the setup.py script for installation

    cd ${D}${bindir}

    python3 setup.py install --root=${D}

}

 

PACKAGES =+ "opencv_python"

FILES_${PN} += "${bindir}/setup.py"

页: 1 我发现以下错误:

 DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
|   warnings.warn(
| Traceback (most recent call last):
|   File "/home/snishuz/.local/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 645, in setup
|     cmkr = cmaker.CMaker(cmake_executable)
|   File "/home/snishuz/.local/lib/python3.10/site-packages/skbuild/cmaker.py", line 148, in __init__
|     self.cmake_version = get_cmake_version(self.cmake_executable)
|   File "/home/snishuz/.local/lib/python3.10/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version
|     raise SKBuildError(msg) from err
|
| Problem with the CMake installation, aborting build. CMake executable is cmake
| WARNING: exit code 1 from a shell command.

Edit:

在@skandigraun评论之后 我尝试使用载于<代码>meta-oe中的收件人。

下面是error

问题回答

我认为,你不需要书写自己的习俗,请做如下尝试:

IMAGE_INSTALL:append = " python3-opencv"

I think python3-opencv is integrated in opencv general recipe. http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/opencv/opencv_4.8.0.bb?h=master#n192





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签