cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with pip3 and 2 packages with new Ecosystem 4.0

Jaison M
Associate II

Hello all, I have stm32mp157dk2 board and I was using zeep package in it (as custom layer with the help of recipe from ST community). Lately got a need for aiortc package but recieved a recipe from community but the employee has tested it new ecosystem, so it didnt work in older one. So as soon they released new ecosystem, I built the distribution package and added both zeep and aiortc to it.

But after flashing the board, pip3 commands are not working, shows "NoModuleFoundError" for "colorsys" whenever I try and the zeep package shows same error for "attr" and aiortc (compiled successfully but) shows "NoModuleFoundError" for "av" . As pip3 is not working I'm unable to get these missing modules. How to fix this issue?

Also I'm putting those recipes below, so any suggestions on changes in these recipes to make them work in new ecosystem is appreciated 🙂

DESCRIPTION = "aiortc is a library for Web Real-Time Communication (WebRTC) and \
Object Real-Time Communication (ORTC) in Python."
HOMEPAGE = "https://github.com/aiortc/aiortc"
SECTION = "devel/python"
 
AUTHOR = "Jeremy Laine"
 
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=907b5e856b2e6bcd8a3cc8d338a6166f"
 
SRC_URI[md5sum] = "3f43e88416113141b0196bdf6c37b444"
SRC_URI[sha256sum] = "15608d7fcf09502d1b8c19b8a63bc22966090ee0761ac9a755e9f747f46d67ab"
 
PYPI_PACKAGE = "aiortc"
 
DEPENDS += " \
    ${PYTHON_PN}-setuptools-scm-native \
    ${PYTHON_PN}-toml-native \
"
 
inherit pypi python_setuptools_build_meta
 
RDEPENDS:${PN} += " \
    ffmpeg \
    libopus \
    libsrtp \
    libvpx \
"
 
BBCLASSEXTEND += "native nativesdk"
DESCRIPTION = "A modern/fast Python SOAP client based on lxml / requests."
HOMEPAGE = "https://docs.python-zeep.org/en/master/"
SECTION = "devel/python"
 
AUTHOR = "Michael van Tellingen"
 
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=8c4f352744f3f0b50054eef4215eeb95"
 
SRC_URI[md5sum] = "f689cc06cefb6ee95b2254b80d0ebd30"
SRC_URI[sha256sum] = "5867f2eadd6b028d9751f4155af590d3aaf9280e3a0ed5e15a53343921c956e5"
 
PYPI_PACKAGE = "zeep"
 
inherit pypi setuptools3
 
BBCLASSEXTEND += "native nativesdk"
 
RDEPENDS_${PN} += " ${PYTHON_PN}-lxml \
    ${PYTHON_PN}-attrs \
    ${PYTHON_PN}-requests \
    ${PYTHON_PN}-requests-file \
    ${PYTHON_PN}-cached-property \
    ${PYTHON_PN}-isodate \
    ${PYTHON_PN}-pytz \
"

5 REPLIES 5
Jean-Marc B
ST Employee

Hi @Jaison M​ 

First of all, there is a typo in the recipe python-zeep_4.1.0.bb: as our ecosystem v4.0.0 is based on Yocto Kirkstone, the syntax has changed and

RDEPENDS_${PN}

should be replaced by

RDEPENDS:${PN}

The «NoModuleFoundError» error means there is a missing dependency in the original recipe and a python module is not found.

For example and from what you wrote, I guess you have the message «NoModuleFoundError: No module named 'av'». That means the python module av (https://pypi.org/project/av/) is not installed in your image. This module is not available through the Yocto environment so you have to write the corresponding recipe python3-av_9.2.0.bb and add it to the RDEPENDS of your recipe.

Best regards,

--JM

Jean-Marc B
ST Employee

Hi again @Jaison M​ 

There is indeed an error in the python3-pip package from the Yocto environment from which our cosystem v4.0.0 is based on.

To fix it, you need to create this recipe:

RDEPENDS:${PN} += " \
  ${PYTHON_PN}-distutils \
  ${PYTHON_PN}-image \
"

However, pip3 often needs a development environment (toolsets, *-src and *-dev packages) to build and install python modules. This development environment is not provided through apt-get commands.

Best regards,

--JM

Okay thanks for your reply, seems like zeep is working now (but once I'll make sure by testing it with the IP camera, but the code doesn't produce any error).

For av, I used pipoe tool to produce a recipe that's given below:

SUMMARY = "Pythonic bindings for FFmpeg's libraries."
HOMEPAGE = "https://github.com/PyAV-Org/PyAV"
AUTHOR = "Mike Boers <pyav@mikeboers.com>"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a9c4cea4308c4521674ecd7c3255d8af"
 
SRC_URI = "https://files.pythonhosted.org/packages/56/e9/8928607b46177d907deeb8a10f40156afab401b7120e63662f392074475b/av-9.2.0.tar.gz"
SRC_URI[md5sum] = "d6e6ba383bf4d49b50e90cfb3bc04680"
SRC_URI[sha256sum] = "f2a7c226724d7f7745b376b459c500d9d17bd8d0473b7ea6bf8ddb4f7957c69d"
 
S = "${WORKDIR}/av-9.2.0"
 
RDEPENDS:${PN} = ""
 
inherit setuptools3

I added the RDEPENDS with (libavcodec, libavdevice, libavfilter, libavformat, libavutil, libswresample, libswscale) as they have been mentioned as dependencies in the pyav's site. But it gives me the similar Cython error that we faced with zeep at the beginning.

For pip(22.1.2) again I used pipoe tool and and added the RDEPENDS that you have provided here, I just finished compiling with no error, but I have flash it into the board yet. I'll provide the recipe for your reference here: (incase you see any mistake, let me know 😊)

SUMMARY = "The PyPA recommended tool for installing Python packages."
HOMEPAGE = "https://pip.pypa.io/"
AUTHOR = "The pip developers <distutils-sig@python.org>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030"
 
SRC_URI = "https://files.pythonhosted.org/packages/4b/b6/0fa7aa968a9fa4ef63a51b3ff0644e59f49dcd7235b3fd6cceb23f202e08/pip-22.1.2.tar.gz"
SRC_URI[md5sum] = "6ec06d38c3aed5d22bcbbbfbf7114d6a"
SRC_URI[sha256sum] = "6d55b27e10f506312894a87ccc59f280136bad9061719fac9101bdad5a6bce69"
 
S = "${WORKDIR}/pip-22.1.2"
 
RDEPENDS:${PN} += " \
  ${PYTHON_PN}-distutils \
  ${PYTHON_PN}-image \
"
 
inherit setuptools3

Hi @Jaison M​ 

For your information, I just updated the package python3-pip 22.0.3 on the packages repository server:

root@stm32mp1:~# apt-cache policy python3-pip
python3-pip:
  Installed: 22.0.3-r0
  Candidate: 22.0.3-r1
  Version table:
     22.0.3-r1 500
        500 http://packages.openstlinux.st.com/4.0 kirkstone/updates armhf Packages
 *** 22.0.3-r0 500
        500 http://packages.openstlinux.st.com/4.0 kirkstone/main armhf Packages
        100 /var/lib/dpkg/status

Best regards,

--JM