這個問題涉及到Openembedded/Yocto。'no module named setuptools',但它包含在DEPENDS變量中
我有源代碼需要由自定義python3腳本編譯。 這意味着,一些python3腳本應該在do_compile()
進程中運行。 該腳本導入setuptools,因此,我在配方中添加了DEPENDS += "python3-setuptools-native"
。據我瞭解的文件,這應該使setuptools模塊可用於建設過程(本機)。 但是,當bitbake執行do_compile()
進程時,出現此錯誤:no module named 'setuptools'
。
讓我把它分解到最小的(非)工作示例:
FILE:test.bb
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://test/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e"
DEPENDS += "python3-setuptools-native"
SRC_URI = "file://test.py \
file://LICENSE"
do_compile() {
python3 ${S}/../test.py
}
FILE:test.py
import setuptools
print("HELLO")
bitbaking:
$ bitbake test
ERROR: test-1.0-r0 do_compile: Function failed: do_compile (log file is located at /path/to/test/1.0-r0/temp/log.do_compile.8532)
ERROR: Logfile of failure stored in: /path/to/test/1.0-r0/temp/log.do_compile.8532
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File "/path/to/test-1.0/../test.py", line 1, in <module>
| import setuptools
| ImportError: No module named 'setuptools'
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /path/to/test/1.0-r0/temp/log.do_compile.8532)
ERROR: Task (/path/to/test.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 400 tasks of which 398 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
Summary: 1 task failed:
/path/to/test.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
我的錯誤是否是錯誤的,DEPENDS += "python3-setuptools-native"
使得python3模塊的'setuptools'可用於do_compile()
中的python3腳本?我怎麼能做到這一點?