Re: [yocto] [Scarthgap] "ModuleNotFoundError: No module named 'imp'"

simone bongini <[email protected]>
Newsgroups org.yoctoproject.lists.yocto
Message-ID <CAHdr16o4TvLxkD20O19P0xw3hMz7w_Anj7mR0dioMSJXxO6zxw@mail.gmail.com>
Hello!
It is meta-atmel that force SWIG to 3.0.8.....

meta-atmel/conf/distro/poky-atmel.conf at scarthgap · linux4sam/meta-atmel
<https://github.com/linux4sam/meta-atmel/blob/scarthgap/conf/distro/poky-atmel.conf>




Il giorno mer 15 ott 2025 alle ore 11:46 Gyorgy Sarvari <
[email protected]> ha scritto:

> On 10/15/25 11:20, simone bongini wrote:
> > Hello,
> > I'm not able to find log.do_configure from libdnf-native, but....
> >
>
> You can recreate is with "bitbake -c configure libdnf-native"
>
> > From the generated error.py of libdnf file I can read
> >
> > # This file was automatically generated by SWIG (http://www.swig.org).
> > # Version 3.0.8
> > #
> > # Do not make changes to this file unless you know what you are
> > doing--modify
> > # the SWIG interface file instead.
> >
> > Indeed I got that the proper version is the 4.2.1, but seems generated
> > from 3.0.8 version
> >
>
> I guess the question is, where does this version come from.
>
> Do you have swig installed on the build host? If yes, which version? I'm
> just curious is maybe somehow cmake breaks out of the build environment,
> and uses a wrong swig... (I just did a test in docker with swig
> installed, and it used the correct version. But that doesn't mean that
> it's impossible.)
> Also, do you happen to have any bbappend or similar modifications for
> either the swig of libdnf recipes?
>
>
> >
> > Il giorno mer 15 ott 2025 alle ore 09:56 Gyorgy Sarvari
> > <[email protected]> ha scritto:
> >
> >     On 10/14/25 12:43, simone bongini via lists.yoctoproject.org
> >     <http://lists.yoctoproject.org> wrote:
> >     > Hello All
> >     > i'm trying to build an image based on scarthgap.
> >     > I'm facing
> >     >
> >     > ERROR: our-image-initramfs-1.0-r0 do_rootfs: Could not invoke dnf.
> >     > Command
> >     >
> >
>  '/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/bin/dnf
> >     > -v --rpmverbosity=info -y -c
> >     >
> >
>  /home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/rootfs/etc/dnf/dnf.conf
> >     >
> >
>  --setopt=reposdir=/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/rootfs/etc/yum.repos.d
> >     >
> >
>  --installroot=/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/rootfs
> >     >
> >
>  --setopt=logdir=/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/temp
> >     >
> >
>  --repofrompath=oe-repo,/home/devlinux/board.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/oe-rootfs-repo
> >     > makecache --refresh' returned 1:
> >     > Traceback (most recent call last):
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/bin/dnf.real",
> >     > line 61, in <module>
> >     >     from dnf.cli import main
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/lib/python3.12/site-packages/dnf/__init__.py",
> >     > line 30, in <module>
> >     >     import dnf.base
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/lib/python3.12/site-packages/dnf/base.py",
> >     > line 29, in <module>
> >     >     import libdnf.transaction
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/lib/python3.12/site-packages/libdnf/__init__.py",
> >     > line 8, in <module>
> >     >     from . import error
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/lib/python3.12/site-packages/libdnf/error.py",
> >     > line 28, in <module>
> >     >     _error = swig_import_helper()
> >     >              ^^^^^^^^^^^^^^^^^^^^
> >     >   File
> >     >
> >
>  "/home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/recipe-sysroot-native/usr/lib/python3.12/site-packages/libdnf/error.py",
> >     > line 15, in swig_import_helper
> >     >     import imp
> >     > ModuleNotFoundError: No module named 'imp'
> >     >
> >     > ERROR: Logfile of failure stored in:
> >     >
> >
>  /home/devlinux/BOARD.1/scarthgap/board-bsp/build-sd96/tmp/work/sama5d27-poky-linux-gnueabi/our-image-initramfs/1.0/temp/log.do_rootfs.3572531
> >     > ERROR: Task
> >     >
> >
>  (/home/devlinux/BOARD.1/scarthgap/board-bsp/meta-sd96/meta-sd96/recipes-core/initramfs/our-image-initramfs.bb:
> do_rootfs)
> >     > failed with exit code '1'
> >     >
> >     > issue caused by Python 3.12 that is not compatible with "imp"
> >     library.
> >     > But, why swig in scarthgap generate error.py that includes "imp"
> >     library?
> >
> >     Interesting question - I think also that it shouldn't do that.
> >     Random first thought: if you look into the log.do_configure of
> >     libdnf-native, what does it say, which version of swig did it
> >     find, and
> >     at what path? Is it v4.2.1, somewhere from ${RECIPE_SYSROOT_NATIVE}?
> >
> >     >
> >     > our-image-initramfs.bb <http://our-image-initramfs.bb>
> >     <http://our-image-initramfs.bb> is an our
> >     > recipes that inherit core-image in order to create a DM-Verity
> >     fitImage.
> >     > Note that it works with kirkstone poky.
> >     >
> >     > Thank you all,
> >     > SB
> >     >
> >     > -=-=-=-=-=-=-=-=-=-=-=-
> >     > Links: You receive all messages sent to this group.
> >     > View/Reply Online (#65930):
> >     https://lists.yoctoproject.org/g/yocto/message/65930
> >     > Mute This Topic:
> https://lists.yoctoproject.org/mt/115750455/6084445
> >     > Group Owner: [email protected]
> >     <mailto:yocto%[email protected]>
> >     > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
> >     [[email protected]]
> >     > -=-=-=-=-=-=-=-=-=-=-=-
> >     >
> >
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.