Update Python instance installed by nRF Connect SDK

Dear Nordic support,

With the installation of every nRF Connect SDK version, there is also a python instance installed with it.

For example, the nRF Connect SDK V2.8.0 installs python version 3.12.4.
To mitigate security vulnerabilities, it is desired to update the used python version whenever necessary.

I haven't found any information on how to update tools while ensuring that the toolchain doesn't break.

Does Nordic provide a guide on how to do this or what is the best approach when updating specific tools?

Thank you in advance!
Best regards
Pascal

  • Hello,

    Pascal Künzi said:
    Unfortunately, we didn't find an easy way to do so. Windows does not list the python instances installed with each nRF Connect SDK version

    Yes, that sounds correct. Each toolchain version includes a sandboxed version of a Python version. The v2.9.0 toolchain includes Python v3.12.4. You can check this version by opening nRF Connect from the VS Code terminal:

    This should open terminal instance within the 2.9.0 toolchain and you can see what version is included by e.g. running python:

    $ python
    Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun  6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

    Øyvind said:
    Updating Python only might break compatibility between Python and scrips in the SDK. Please test compatibility of toochain v2.9.0 and sdk v2.9.0 with e.g. basic west commands, etc. To verify no issues. 

    I might have been somewhat unclear in my previous answer, but there is no way of updating the version inside the sandboxed toolchain package. Doing so will brake the version and you will be on your own in regards to support.

    Asking our developers, they provide the following response:

    If they want to deviate from the provided toolchains, doing their own installations altogether might be the better idea. The trade-off is described in https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation/install_ncs.html#alternative_method_installation_with_toolchain_manager: “System-wide installation is an alternative to the recommended installation methods using the nRF Connect for VS Code extension or nRF Util. It gives you more control over each of the required tools, but requires more familiarity with Zephyr and with each of the tools.”

    Pascal Künzi said:
    Are those regular python installs or is that some kind of portable version?

    I would assume that the sandboxed version is some kind of portable version. 

    Kind regards,
    Øyvind

  • Hi Øyvind

    Thank you and your developers for the further information and the link to the alternate installation methods.

    Going ahead, we will keep the system wide installation in mind.

    Best regards,
    Pascal

Related