Search code examples
pythonlinuxyocto

Using Yocto with a distribution using python3 by defaults


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 !