Help enabling meta-python-ai in Yocto build

Hi Toradex community,

I’m trying to include meta-python-ai in my Yocto build because I need meta-scipy for my application. When I run:

ERROR: Layer 'meta-python-ai' depends on layer 'clang-revival-layer', but this layer is not enabled in your configuration

I tried cloning the required clang-revival-layer:

cd /mnt/yocto_build/layers
git clone -b scarthgap https://github.com/kraj/meta-clang-revival.git

…but it prompts for a username and password and doesn’t accept them.

Could someone guide me on the correct way to add this layer and get meta-python-ai (and thus meta-scipy) working in my build?

Thanks,
Raju

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Adding Python AI and SciPy Support to Toradex Yocto Builds

Hi Raju,

For machine learning and scientific computing applications on Toradex modules, I recommend using the officially supported approach documented in our BSP.

Recommended Approach: Use meta-imx-ml Layer

Instead of meta-python-ai, Toradex documentation shows how to add machine learning support using the meta-imx-ml layer (1). This approach includes scientific computing libraries and is specifically tested with Toradex modules.

Here’s the process:

  1. Clone the meta-imx repository (1):
$ git clone --depth 1 -b scarthgap-6.6.36-2.1.0 https://github.com/nxp-imx/meta-imx.git ../meta-imx
  1. Create and configure the meta-imx-ml layer (1):
$ bitbake-layers create-layer ../layers/meta-imx-ml
$ bitbake-layers add-layer ../layers/meta-imx-ml
$ rm -rf ../layers/meta-imx-ml/recipes-example
  1. Copy the ML recipes (1):
$ cp -r ../meta-imx/meta-imx-ml/recipes-* ../layers/meta-imx-ml/
  1. Add Python scientific computing support to your image (1):
$ echo 'IMAGE_INSTALL:append = " tensorflow-lite tensorflow-lite-vx-delegate opencv python3-pillow adwaita-icon-theme "' >> conf/local.conf

Alternative: Using meta-clang for Browser Support

If you specifically need clang support (as shown in our browser documentation), use the correct meta-clang repository (2):

$ git clone -b dunfell https://github.com/kraj/meta-clang.git

Then add it to your bblayers.conf (2):

${TOPDIR}/../layers/meta-clang \

Customizing Yocto Builds

For additional Python packages and scientific computing libraries, our documentation recommends creating custom meta-layers (3). This approach ensures compatibility with Toradex BSP layers and provides better long-term maintainability.

The supported approach uses the Toradex BSP layers combined with NXP’s meta-imx-ml layer, which includes the scientific computing stack you need without the authentication issues you’re encountering.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @raju3003

This repository either doesn’t exist or is a private repository (which’s why GitHub is asking for your credentials).


If you are not familiar with Yocto development.
We recommend you using Torizon OS with our Python template.
This way installing your python dependencies is as easy as adding it to your requirements.txt

Hi @raju3003

well…
If you want to stick with using Yocto, I recommend that you read the Yocto documentation. :sweat_smile: