Using Yocto with a distribution using python3 by defaults

Issue

More and more Linux distributions use python 3.x as default python, but Yocto still uses python 2.7. How to use Yocto with one of those distributions?

Solution

Yocto always runs in a virtualenv. But I’ve found a way to trick it to use python 2 , setting the default python and including it in PATH env variable:

$ source oe-init-build-env build
$ mkdir build/python-bin
$ ln -s /usr/bin/python2 build/python-bin/python
$ ln -s /usr/bin/python2-config build/python-bin/python-config
$ export PATH=$(pwd)/build/python-bin:${PATH}

Thanks all for your help !

Answered By – Shan-x

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published