简体   繁体   中英

ImportError in bitbake

I want to make a Yocto image for my hardware (ie IMX8) according to this manual:

https://github.com/compulab-yokneam/meta-bsp-imx8mm/blob/iot-gate-imx8_r3.1/README.md

I installed python3, and python2 on my Linux (Ubuntu 22.04) that is run on on VMWare virtual machine.

I configure my python using update-alternatives and I can alter and check the Python version, and every thing is correct. But I encounter with the following message when I run the bitbake command:

Traceback (most recent call last):
  File "/home/sap1359/compulab/sources/poky/bitbake/bin/bitbake", line 19, in <module>
    import bb
  File "/home/sap1359/compulab/sources/poky/bitbake/lib/bb/__init__.py", line 128, in <module>
    from bb import fetch2 as fetch
  File "/home/sap1359/compulab/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 26, in <module>
    import bb.persist_data, bb.utils
  File "/home/sap1359/compulab/sources/poky/bitbake/lib/bb/persist_data.py", line 22, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

When I try to track another tutorial for other hardware or even for a simple X86 Yocto image,there is something the same as this error cannot import name 'someting' from 'collections' .

I also tried using virtualenv and setting up an virtual environment, however, the Import error persist.

I checked using Ubuntu 18.04, everything was OK. According to my tests, this Yocto project can't work with Python3.10 and above, however, works in Ubuntu 22.04 by installing another version of Python3 such as 3.8. I just want to mention that this Yocto source just uses Python3.5, or above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM