Hi
This post is a NCS v2.0.x follow up for devzone.nordicsemi.com/.../nanopb-and-ncs-python-standard-libs
In the previous post the issue was solved by running in a virtual environment (python v3.8) and installing the required packages and placing a py.bat handling calls from protoc-gen-nanopb.bat
With NCS v2.0.0 default toolchain has changed to Zephyr SDK toolchain. And the python invoked from the build process seems to be the one placed in toolchains\v2.0.0\opt\bin\python.exe regardless of running in a virtual environment. Hence the virtual environment solution no longer seems feasible.
A workaround is to add py.bat to toolchains\v2.0.0\opt\bin and install the required packages in Zephyr SDK toolchain python site-packages.
Since NanoPb is natively supported by NCS/Zephyr, I think its time to find add a more future proof solution to avoid this situations.
As I see it the Zephyr SDK toolchain python scope must include required site packages for handling nanopb generation and a solution to avoid invoking the system python from protoc-gen-nanopb.bat via py.exe should be found.
This might be more a Zephyr issue, but I assume Nordic is heavily involved in maintaining the project.
Best regards
Anders