Python trouble

Hi

I need a little assistance in hunting down an error in my meta-ros usage
roswtf keep reporting “mportError: No module named importlib”

This is clearly a missing python dependency somewhere, but where ??

I made my own packagegroup to pull in the ros components i want on target

BR Lars Larsen
quoted files below:


My bblayers.conf

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
  ${POKYROOT}/meta \
  ${POKYROOT}/meta-poky \
  ${POKYROOT}/meta-yocto-bsp \
  ${POKYROOT}/meta-linaro/meta-linaro \
  ${POKYROOT}/meta-ros \
  ${POKYROOT}/meta-fpe \
  ${POKYROOT}/meta-fpe/meta-overloads \ 
  ${POKYROOT}/meta-openembedded/meta-networking \
  ${POKYROOT}/meta-openembedded/meta-oe \
  ${POKYROOT}/meta-openembedded/meta-python \	
  "

  
BBLAYERS_NON_REMOVABLE ?= " \
  ${POKYROOT}/meta \
  ${POKYROOT}/meta-poky \
  "

Git status

meta              
meta-poky         
meta-yocto-bsp    = "morty:5aa481dfedfd089f0d6e8a3bae1b84134d5dff4c"
meta-linaro       = "morty:69a8bac680362906c9d261424c62749f7e555ca2"
meta-ros          = "master:8a3adc1a6542f2c8a40b36021a78dc1057e3ed08"
meta-fpe          
meta-overloads    = "develop:3672ef2e2beb9b23d177d0a98afc40306c6f9397"
meta-networking   
meta-oe           
meta-python       = "morty:1efa5d623bc64659b57389e50be2568b1355d5f7"

packagegroup-fpe-ros.bb

DESCRIPTION = "fpe_ros package group, ros elements used by bfw"
LICENSE = "MIT"

inherit packagegroup

PACKAGES = "${PN}"

# Add ROS components to pull in
# this is basically a copy of packagegroup-ros-comm.bb 
# deleted: rosbag rosbag-storage 
# catkin changed to catkin-runtime


RDEPENDS_${PN} = "\
    rosconsole \
    rosparam \
    catkin-runtime \
    genmsg \
    rosgraph \
    genpy \
    rosbuild \
    rospack \
    rosmake \
    rosboost-cfg \
    rosbash \
    roslib \
    roscreate \
    mk \
    rosclean \
    rosunit \
    roslang \
    roscpp \
    rosout \
    roscpp-serialization \
    roscpp-traits \
    topic-tools \
    rostest \
    rostopic \
    message-generation \
    cpp-common \
    genlisp \
    message-filters \
    rosservice \
    rospy \
    rosgraph-msgs \
    rosnode \
    std-srvs \
    xmlrpcpp \
    roslaunch \
    rosmaster \
    roswtf \   
    rosmsg \
    std-msgs \
    message-runtime \
    rostime \
    gencpp \
    genlisp \
    "

    
    

#      python-rospkg \

The importlib module is a part of the standard library in python3 (also available in python2.7). You may want to check correctness of your python installation or PYTHONPATH.

Thanks I figured that out to,

on my desktop and build machine importlib resides in /usr/lib/python2.7/importlib
which i guess is the standard location
but it is missing on target

My PYTHONPATH on target is ok.

I do not actively include any python into my build.
I rely solely on what meta-ros will bring onboard, via depend statements and clearly a depend is missing.
but which one will bring on importlib?

The standard library is a part of python. I guess the recipe for roswtf (and probably the one for rospy too) needs something like

RDEPENDS_${PN} += ${PYTHON_PN}

added to it.

I solved it !
Or rather I hacked my may to a working solution.
this is clearly not the right, kosher solution, but I’ve been hunting it to long, to spend more time.

I did:
make a bbappend to roswtf
and adding

RDEPENDS_${PN} += “python-importlib”

-Lars

It’s better to add this line to your local.conf

IMAGE_INSTALL_append += " python3-importlib"
or
IMAGE_INSTALL_append += " python3-core python3-modules"