我需要在自定义配方中使用 pip,并决定为其创建一个 python3-pip,因为 yocto 由于缺少它而抛出错误。这是我当前的文件:
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}"
由于某种原因,它不断向我抛出错误;
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'#
最初我没有 do_compile() 但在询问之前尝试获得一些帮助,但仍然无法使其正常工作。有什么建议吗?
注意:我正在为以下机器构建这个:imx8mpevk
如果 openembedded-core 中已经存在 python3-pip 配方,为什么还要创建它?只需将其添加到
IMAGE_INSTALL:append "python3-pip"
[1]
要在配方中使用 pip,您只需
inherit pip
并在 PYPI_PACKAGE
中传递包名称,例如:python3-ansi2html_1.7.0.bb