Hi,

I tried to bake pmu-firmware recipe.  I got "Exception: ImportError: No module 
named 'yaml'"

because in class xsctyaml.bbclass PYTHON_SITEPACKAGES_DIR is set to 
/usr/lib64/python3.5/site-packages while python native is at /usr/lib... 
instead of

/usr/lib64/...


My fix is attached.


Thanks.

Hafiz Abdul karim
From 6d12a958f57333be4e0f4c4b05804a35c33ea099 Mon Sep 17 00:00:00 2001
From: abdulkarim17 <hafizabdul_ka...@mentor.com>
Date: Thu, 16 Aug 2018 19:31:55 +0500
Subject: [PATCH] xsctyaml.bbclass: Fix PYTHON_SITEPACKAGES_DIR
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

PYTHON_SITEPACKAGES_DIR is set to /usr/lib64/python3.5/site-packages
but python native is at /usr/lib/…. not in /usr/lib64. Which causes 
the following error:

ERROR: fsbl-2018.2+gitAUTOINC+6e82c0183b-r0 do_create_yaml: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_create_yaml(d)
     0003:
File: '/data/hkarim/elm-06/meta-xilinx-tools/classes/xsctyaml.bbclass', lineno: 64, function: do_create_yaml
     0060:
     0061:python do_create_yaml() {
     0062:    import sys, os
     0063:    os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR')[1::]))
 *** 0064:    import yaml
     0065:    yaml_dict = {}
     0066:
     0067:    appconfig = (d.getVar("YAML_APP_CONFIG", True) or "").split()
     0068:    if appconfig:
Exception: ImportError: No module named 'yaml'

ERROR: fsbl-2018.2+gitAUTOINC+6e82c0183b-r0 do_create_yaml: Function failed: do_create_yaml
ERROR: Logfile of failure stored in: /data/hkarim/elm-06/build_uz_2018.3_xlnx/tmp/work/ultrazed_eg_iocc_mel-mel-linux/fsbl/2018.2+gitAUTOINC+6e82c0183b-r0/temp/log.do_create_yaml.4281
ERROR: Task (/data/hkarim/elm-06/meta-xilinx-tools/recipes-bsp/fsbl/fsbl_git.bb:do_create_yaml) failed with exit code '1'

Signed-off-by: abdulkarim17 <hafizabdul_ka...@mentor.com>
---
 classes/xsctyaml.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/classes/xsctyaml.bbclass b/classes/xsctyaml.bbclass
index bf7ca5f..2e56b59 100644
--- a/classes/xsctyaml.bbclass
+++ b/classes/xsctyaml.bbclass
@@ -12,6 +12,8 @@ YAML_MAIN_MEMORY_CONFIG ?= ''
 YAML_CONSOLE_DEVICE_CONFIG ?= ''
 YAML_FLASH_MEMORY_CONFIG ?= ''
 
+PYTHON_SITEPACKAGES_DIR_NATIVE = "${libdir_native}/${PYTHON_DIR}/site-packages"
+
 YAML_SERIAL_CONSOLE_STDIN_ultra96-zynqmp ?= "psu_uart_1"
 YAML_SERIAL_CONSOLE_STDOUT_ultra96-zynqmp ?= "psu_uart_1"
 
@@ -60,7 +62,7 @@ def patch_yaml(config, configflags, type, type_dict, d):
 
 python do_create_yaml() {
     import sys, os
-    os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR')[1::]))
+    os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR_NATIVE')[1::]))
     import yaml
     yaml_dict = {}
 
-- 
2.7.4

-- 
_______________________________________________
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx

Reply via email to