0

I need to use pip in a custom recipe and decided to create a python3-pip for it seeing as yocto was throwing an error due to it missing. This is the current file I have:

DESCRIPTION = "Python package installer for Python 3"
HOMEPAGE = "https://pypi.org/project/pip/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030"
SRC_URI = "git://github.com/pypa/pip.git;branch=main;protocol=https;name=pip"
SRCREV_pip = "97146c7f4cd85551f3dc261830a57f304e43c181"
S = "${WORKDIR}/git"
inherit /opt/yocto/imx-5.15.71-2.2.0/kirkstone/sources/poky/meta/classes/setuptools3.bbclass
DEPENDS = "python3-setuptools"
do_compile() {
 cd ${S}
 python3 setup.py build
}
do_install() {
 cd ${S}
 python3 setup.py install --root=${D} --prefix=/usr
}
FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}"

For some reason, it keeps throwing me an error;

ERROR: python3-pip-1.0-r0 do_compile: ExecutionError('/opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/temp/run.do_compile.368349', 2, None, None)
ERROR: Logfile of failure stored in: /opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/temp/log.do_compile.368349
Log data follows:
| DEBUG: Executing shell function do_compile
| python3: can't open file '/opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/git/setup.py': [Errno 2] No such file or directory
| WARNING: /opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/temp/run.do_compile.368349:152 exit 2 from 'python3 setup.py build'
| WARNING: Backtrace (BB generated script):
| #1: do_compile, /opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/temp/run.do_compile.368349, line 152
| #2: main, /opt/yocto/imx-5.15.71-2.2.0/kirkstone/bld-xwayland/tmp/work/armv8a-poky-linux/python3-pip/1.0-r0/temp/run.do_compile.368349, line 156
ERROR: Task (/opt/yocto/imx-5.15.71-2.2.0/kirkstone/sources/meta-custom/recipes-apps/python3-pip/python3-pip.bb:do_compile) failed with exit code '1'#

Initially I didn't have the do_compile() but before asking here tried to get some help but still couldn't manage to get it working. Any advice?

Notes: I'm building this for the following machine: imx8mpevk

asked Aug 23, 2024 at 19:42

1 Answer 1

0

Why did you create a python3-pip recipe if it already exists inside openembedded-core? Just add it in IMAGE_INSTALL:append "python3-pip" [1]

And to use pip in a recipe you just need to inherit pip and pass the package name in PYPI_PACKAGE, example: python3-ansi2html_1.7.0.bb

answered Oct 20, 2024 at 18:48
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.