【问题标题】:Yocto setup.py requires pyserialYocto setup.py 需要 pyserial
【发布时间】:2016-08-08 12:12:15
【问题描述】:

我正在尝试将 https://github.com/kliment/Printrun 打包到 Yocto 食谱中,但无法使其正常工作。我的食谱目前如下所示:

LICENSE = "AGPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"

PV = "2.7"
SRCREV = "0193a9dbe31458c45059bf2dcb0a9905b7bb06fc"
SRC_URI = "git://github.com/kliment/Printrun.git;protocol=git;branch=master"

RDEPENDS_${PN} = "python-cython \
                  python-pyserial \
"

S = "${WORKDIR}/git"

inherit distutils

我假设这是我需要做的,因为它有一个继承自 distutils 的 setup.py?如果是这样,这不起作用,我收到一个错误,抱怨缺少串行模块:

DEBUG: Executing shell function do_compile
WARNING: Failed to cythonize: No module named Cython.Build
Traceback (most recent call last):
  File "setup.py", line 36, in <module>
    from printrun.printcore import __version__ as printcore_version
  File "/home/gerhard/Jethro/yocto/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/printrun/2.7-r0/git/printrun/printcore.py", line 20, in <module>
    from serial import Serial, SerialException, PARITY_ODD, PARITY_NONE
ImportError: No module named serial
ERROR: python setup.py build execution failed.
ERROR: Function failed: do_compile (log file is located at /home/gerhard/Jethro/yocto/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/printrun/2.7-r0/temp/log.do_compile.15542)

我也希望能够用 cython 编译小型 cythonable 模块。由于某种原因,即使我将它们添加为 rdepends,cython 和 psyerial 也不可用,我做错了什么?

【问题讨论】:

  • 报错说有日志文件,你看了吗?
  • @stdcall 是的,那个错误块就是日志文件
  • 你用谷歌搜索Failed to cythonize: No module named Cython.Build
  • 是的,但这是来自该项目的自定义消息,没有命中,所以我猜还没有人用 yocto 尝试过,这不足为奇...

标签: python embedded-linux yocto bitbake


【解决方案1】:

您仅在运行时添加了对 python cython 的依赖。我想您还需要添加以进行编译。

DEPENDS_${PN} = "python-cython \
                  python-pyserial"

【讨论】:

  • 并不奇怪。它清楚地表明包裹丢失并且找不到它。你确定它存在吗?
  • 是的,如果我只是安装 python-pyserial 然后在设备上运行该程序,那么它运行良好。我认为让安装脚本依赖于它是很疯狂的,并且只会修补它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-05-13
  • 2021-06-25
  • 2020-08-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-09
  • 2018-10-09
相关资源
最近更新 更多