NanoPB and NCS python standard libs

Hi 

Im am struggling getting nanopb to parse proto files in NCS toolchain zephyr context.

It appears that the python38 embedded in NCS toolchain does not include all standard libraries.

From the trace below it can be seen that the plistlib is included from my global python310 install which ends up in af version conflict

Is is possibly to run the NCS build in a true virtual python environment or is it possible to add the standard libraries for the embedded python version in NCS

Traceback (most recent call last):
File "D:\bluebird\build\nanopb\generator\nanopb_generator.py", line 51, in <module>
from .proto import nanopb_pb2
ImportError: attempted relative import with no known parent package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\bluebird\build\nanopb\generator\nanopb_generator.py", line 72, in <module>
import proto.nanopb_pb2 as nanopb_pb2
File "D:\bluebird\build\nanopb\generator\proto\__init__.py", line 7, in <module>
import pkg_resources
File "c:\nordic\v1.8.0\toolchain\opt\bin\Lib\site-packages\pkg_resources\__init__.py", line 32, in <module>
import plistlib
File "C:\Python310\lib\plistlib.py", line 61, in <module>
from xml.parsers.expat import ParserCreate
File "c:\nordic\v1.8.0\toolchain\opt\bin\Lib\site-packages\xml\parsers\expat.py", line 4, in <module>
from pyexpat import *
ImportError: Module use of python38.dll conflicts with this version of Python.
--nanopb_out: protoc-gen-nanopb: Plugin failed with status code 1.

Parents Reply Children
Related