Search code examples
pythonlinuxpython-3.xyoctobitbake

Yocto Warrior Custom Bitbake Recipe for Custom Python Wheel file cannot install because pip3 not found


I am using meta-tegra to build a custom image for my NVIDIA Jetson Nano. I need PyTorch, but there is no recipe for it. I built PyTorch on the device and packaged it into a wheel on the device. Now, I want to integrate that wheel into my custom Yocto layer. My image includes python3-pip and I can launch pip3 on my device. The problem is that when I try to execute my bitbake recipe, Bitbake always fails with the following error:

/home/ubuntu/Desktop/comp-jetson-yocto/build/tmp/work/jetson_nano-poky-linux/torch/1.1.0-r0/temp/run.do_install.16557: 115: /home/ubuntu/Desktop/comp-jetson-yocto/build/tmp/work/jetson_nano-poky-linux/torch/1.1.0-r0/temp/run.do_install.16557: pip3: not found

Here is my recipe:

DESCRIPTION = "NVIDIA's version of Python Torch"
HOMEPAGE = "https://nvidia.com"
LICENSE = "BSD-3-Clause"

inherit setuptools3

RDEPENDS_${PN} = "python3 \
                  python3-pip \
                  "

SRC_URI = "\
        file://torch-1.1.0-cp37-cp37m-linux_aarch64.whl \
        file://LICENSE \
"

SRC_URI[md5sum] = "9ec85425a64ca266abbfdeddbe92fb18"
SRC_URI[sha256sum] = "3b9b8f944962aaf550460409e9455d6d6b86083510b985306a8012d01d730b8b"

COMPATIBLE_MACHINE = "(tegra)"
COMPATIBLE_MACHINE_comp = "(-)"

LIC_FILES_CHKSUM = "file://../LICENSE;md5=acf4d595f99e159bf31797aa872aef57"

S = "${WORKDIR}/${PN}-${PV}"

do_configure() {
        :
}

do_compile() {
        :
}

do_install() {
        pip3 install torch-1.1.0-cp37-cp37m-linux_aarch64.whl
}

PACKAGE_ARCH = "jetson_nano"

I have not been able to locate anything useful on Google on how to have my recipe install a custom wheel file with pip. How can I accomplish this? Thank you.


Solution

  • Bitbake needs native version of pip3:

    DEPENDS = "python3-pip-native"