Hi @RoccoBr ,
We managed to get Python 3.9 into TorizonCore 5.7.0 using Yocto. Version 3.8 is still present in the final image but 3.9.9 is used by default when invoking and it is the default version. To invoke the newer one you have to enter python3
on the terminal.python3.9
.
We created a new layer that has an adapted Python recipe from hardknott with a different name (called python3.9 instead of python3). This layer also removes symbolic links that point to 3.8, and adds the newer version as dependency on some recipes that need Python. You can find the layer attached here:
meta-custom-v3.1.zip (63.3 KB)
The steps to add it are:
-
Put the meta-custom directory in
layers/
; -
Add an entry in
conf/bblayers.conf
like this:
[...]
BBLAYERS = " \
${OEROOT}/layers/meta-toradex-torizon \
${OEROOT}/layers/meta-toradex-distro \
${OEROOT}/layers/meta-toradex-bsp-common \
${BASELAYERS} \
${BSPLAYERS} \
${EXTRALAYERS} \
${OEROOT}/layers/openembedded-core/meta \
+ ${OEROOT}/layers/meta-custom \
"
- Append this line in
conf/local.conf
to add the recipe to the image:
CORE_IMAGE_EXTRA_INSTALL += "python3.9"
- Build the image with:
$ MACHINE=<SoM> bitbake -k torizon-core-docker
Where <SoM>
is the module name, like verdin-imx8mm
.
Let me know if this helps you.
Best regards,
Lucas Akira
EDIT: Updated meta-custom to v2 as to remove a specific Python 3.8 native file that can conflict with 3.9 native during build.
EDIT 2: Updated meta-custom to v3, as docker-compose didn’t work before due to conflicts between the Python versions. This should be resolved now, as 3.8 was left unaltered and 3.9 was installed with make altinstall
, see GitHub - python/cpython: The Python programming language.