<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106379/ncs-cmake-unable-to-execute-python</link><description>When I try to build any application with west I always get a CMake error complaining that it is unable to run the Python version included with the NCS toolchain. The error log: CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Oct 2024 19:57:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106379/ncs-cmake-unable-to-execute-python" /><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/507649?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 19:57:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01070fd2-9348-4170-b94f-62e5350462b1</guid><dc:creator>Burt</dc:creator><description>&lt;p&gt;I have been investigating this problem in a specific environment, using nrfutil, and I think I can give a pretty good explanation, although I may not have all the detailed answers.&lt;/p&gt;
&lt;p&gt;I have installed nrfutil, its toolchain-manager, and toolchains v2.5.0 and v2.7.0. I also installed the corresponding SDKs using the nRF Connect for Desktop toolchain-manager (actually, that&amp;#39;s how I installed both the SDK and toolchain, as they are installed in one step). Presumably I installed v2.5.0 and then v2.7.0 at a later date.&lt;/p&gt;
&lt;p&gt;Now look at this command and it&amp;#39;s output:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;burt@T420s:~$ nrfutil toolchain-manager list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt; Version Toolchain&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; v2.5.0 /home/burt/ncs/toolchains/7795df4459&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;* v2.7.0 /home/burt/ncs/toolchains/e9dba88316&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;Notice the asterisk is at v2.7.0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;Suppose I try this build&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;burt@T420s:~$ cd ~/ncs/v2.5.0/nrf/applications/asset_tracker_v2/&lt;br /&gt;burt@T420s:~/ncs/v2.5.0/nrf/applications/asset_tracker_v2$ rm -rf build&lt;br /&gt;burt@T420s:~/ncs/v2.5.0/nrf/applications/asset_tracker_v2$ west build -b nrf9160dk_nrf9160_ns&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;I could have added -p (pristine) to the build command rather than removing the build directory; either way is fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;The build succeeds. What most of us won&amp;#39;t notice is that the build is being done with the v2.7.0 toolchain; the latest one I have installed. Depending on your philosophy, using the latest toolchain is a good thing, or you will believe that the v2.5.0 toolchain should be used for building v2.5.0 SDK code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;One thing I will mention here is that the v2.5.0 toolchain has python 3.8 included in it, whereas the v2.7.0 toolchain has python 3.9 included.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I probably had been building this way for a while when one day I listed the toolchains and noticed the asterisk at v2.7.0. Devzone pointed out that I could change this using&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;burt@T420s:~/ncs/v2.5.0/nrf/applications/asset_tracker_v2$ nrfutil toolchain-manager install --ncs-version v2.5.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;[00:00:00] ###### 100% [Install toolchain] Toolchain with version v2.5.0 already installed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;burt@T420s:~/ncs/v2.5.0/nrf/applications/asset_tracker_v2$ nrfutil toolchain-manager list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; Version&amp;nbsp; Toolchain&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;* v2.5.0&amp;nbsp;&amp;nbsp; /home/burt/ncs/toolchains/7795df4459&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; v2.7.0&amp;nbsp;&amp;nbsp; /home/burt/ncs/toolchains/e9dba88316&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You see that the asterisk was moved to v2.5.0. You can also look at some environment variables&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;burt@T420s:~/ncs/v2.5.0/nrf/applications/asset_tracker_v2$ nrfutil toolchain-manager env&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;GIT_EXEC_PATH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/local/libexec/git-core&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;GIT_TEMPLATE_DIR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/local/share/git-core/templates&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;LD_LIBRARY_PATH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/lib:/home/burt/ncs/toolchains/7795df4459/usr/lib/x86_64-linux-gnu:/home/burt/ncs/toolchains/7795df4459/usr/local/lib:/home/burt/.nrfutil/lib/nrfutil-toolchain-manager&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;PATH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/bin:/home/burt/ncs/toolchains/7795df4459/usr/bin:/home/burt/ncs/toolchains/7795df4459/usr/local/bin:/home/burt/ncs/toolchains/7795df4459/opt/bin:/home/burt/ncs/toolchains/7795df4459/opt/nanopb/generator-bin:/home/burt/ncs/toolchains/7795df4459/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/home/burt/ncs/toolchains/7795df4459/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/home/burt/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin:/home/burt/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/burt/.nrfutil/bin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;PYTHONHOME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/local&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;PYTHONPATH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/usr/local/lib/python3.8:/home/burt/ncs/toolchains/7795df4459/usr/local/lib/python3.8/site-packages&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;ZEPHYR_SDK_INSTALL_DIR&amp;nbsp;&amp;nbsp; : /home/burt/ncs/toolchains/7795df4459/opt/zephyr-sdk&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;ZEPHYR_TOOLCHAIN_VARIANT : zephyr&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You see that 7795df4459 shows up frequently in the environment, including in the two PYTHON related variables.&lt;/p&gt;
&lt;p&gt;I added some debug messages to the cmake files (cmake is called by the west wrapper) and I see this:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS NcsToolchainConfig.cmake entered...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS NCS_TOOLCHAIN_PATH=&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS NCS_TOOLCHAIN_PATH=/home/burt/ncs/toolchains/e9dba88316&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;-- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/burt/ncs/toolchains/e9dba88316/cmake)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS just set Python3_EXECUTABLE and PYTHON_EXECUTABLE=/home/burt/ncs/toolchains/e9dba88316/usr/local/bin/python3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS zephyr python.cmake entered...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS python.cmake about to find_package Python3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS fn FIND_PACKAGE_HANDLE_STANDARD_ARGS entered _NAME=Python3 _FIRST_ARG=REQUIRED_VARS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS FIND_PACKAGE_HANDLE_STANDARD_ARGS line508&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS FIND_PACKAGE_HANDLE_STANDARD_ARGS line 568&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS FIND_PACKAGE_HANDLE_STANDARD_ARGS NAME not found&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;BMS FIND_PACKAGE_HANDLE_STANDARD_ARGS line 599, Could NOT find Python3 missing&amp;nbsp; Interpreter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;CMake Error at /home/burt/ncs/toolchains/7795df4459/usr/local/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; Could NOT find Python3 (missing: Interpreter) (Required is at least version&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp; &amp;quot;3.8&amp;quot;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reason given by package: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interpreter: Cannot run the interpreter &amp;quot;/home/burt/ncs/toolchains/e9dba88316/usr/local/bin/python3&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You see what&amp;#39;s happening: part of the build system is intent on using the latest toolchain available, despite the asterisk by v2.5.0. (e9dba88316 is the v2.7.0 toolchain). But part of the build system is looking for stuff in the v2.5.0 toolchain. So the build tries to use a python 3.9 executable with python 3.8 libraries, etc. The cmake find_package code catches the mistake and exits with an error.&lt;/p&gt;
&lt;p&gt;To do a build with v2.5.0 and nrfutil, you must do two things:&lt;/p&gt;
&lt;p&gt;1) reinstall the v2.5.0 toolchain so the asterisk points to it.&lt;br /&gt;2) add -- -DNCS_TOOLCHAIN_VERSION=NONE to the command line. This is what is done in VS Code.&lt;/p&gt;
&lt;p&gt;Step 2 is also useful when using nRF Connect for Desktop&amp;#39;s toolchain-manager.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/459257?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 20:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9c8db2b-fc4c-4545-ba9e-9567428bba5b</guid><dc:creator>JRPC</dc:creator><description>&lt;p&gt;I found that if I turn off the installation of the ncs toolchain, it works perfectly with the default builder using python with virtual environments. if I install NCS via toolchain manager, west defaults to using python installed by the toolchain manager, even if the console is not initiated. - and if you don&amp;#39;t initialize the console before building, like `nrfutil toolchain-manager launch --shell`, then the build will fail, since the &amp;quot;default&amp;quot; West build still relies on the toolchain manager specified versions, even though the shell was not launched; and since the shell is not launched, it&amp;#39;s missing some parameters set by the custom shell.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Instead of using the ncs shell, I use a Docker based solution, where I wrote a specific dockerfile for each individual type of custom firmware I want to build:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="python"&gt;# Prepare the environment variables for building the firmware
FROM ubuntu:mantic
ENV DEBIAN_FRONTEND noninteractive
RUN rm /bin/sh &amp;amp;&amp;amp; ln -s /bin/bash /bin/sh
ENV VIRTUAL_ENV=/opt/venv
ENV PATH=&amp;quot;$VIRTUAL_ENV/bin:$PATH&amp;quot;

# Update image and install necessary packages
RUN apt update &amp;amp;&amp;amp; apt install -y apt-utils
RUN apt upgrade -y
RUN apt install -y --no-install-recommends \
    openssl \
    wget \
    xz-utils \ 
    file \
    ninja-build \
    make \
    gcc \
    gcc-multilib \
    g++-multilib \
    libssl-dev \
    libsdl2-dev \
    dfu-util \
    git \
    flex \
    bison \
    bzip2 \
    udev \
    libxcb-render0 \
    libxcb-render-util0 \
    libxcb-shape0 \
    libxcb-icccm4 \
    libxcb-keysyms1 \
    libxcb-image0 \
    libxkbcommon-x11-0 \
    libfontconfig1 \
    libfreetype6 \
    ca-certificates

# Install packages manually, since they are not provided pre-packaged by the ubuntu repositories
RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz &amp;amp;&amp;amp; \
    tar -zxvf cmake-3.22.2.tar.gz &amp;amp;&amp;amp; \
    mv cmake-3.22.2 /opt/cmake &amp;amp;&amp;amp; \
    cd /opt/cmake &amp;amp;&amp;amp; \
    ./bootstrap &amp;amp;&amp;amp; \
    make -j`nproc` &amp;amp;&amp;amp; \
    make install &amp;amp;&amp;amp; \
    rm /cmake-3.22.2.tar.gz

# Install GNU Arm Embedded Toolchain
RUN wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 &amp;amp;&amp;amp; \
    tar -jxvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 &amp;amp;&amp;amp; \
    mv gcc-arm-none-eabi-9-2020-q2-update /opt/gnuarmemb &amp;amp;&amp;amp; \
    rm /gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2

# Install dtc
RUN wget https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/dtc-1.6.1.tar.gz &amp;amp;&amp;amp; \
    tar -zxvf dtc-1.6.1.tar.gz &amp;amp;&amp;amp; \
    mv dtc-1.6.1 /opt/dtc-1.6.1 &amp;amp;&amp;amp; \
    cd /opt/dtc-1.6.1 &amp;amp;&amp;amp; \
    make -j`nproc` &amp;amp;&amp;amp; \
    make install &amp;amp;&amp;amp; \
    rm /dtc-1.6.1.tar.gz 

# Install Python 3.8
RUN wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz &amp;amp;&amp;amp; \
    tar -zxvf Python-3.8.0.tgz &amp;amp;&amp;amp; \
    cd Python-3.8.0 &amp;amp;&amp;amp; \
    ./configure --enable-optimizations &amp;amp;&amp;amp; \
    make -j`nproc` &amp;amp;&amp;amp; \
    make install &amp;amp;&amp;amp; \
    rm /Python-3.8.0.tgz

# Prepare Python virtual environment
RUN python3.8 -m venv $VIRTUAL_ENV
RUN python3.8 -m pip install --upgrade pip wheel
RUN python3.8 -m pip install --upgrade west tk setuptools setuptools-rust intelhex pyelftools docopt click cryptography cbor

# Install zephyr-sdk
RUN wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64.tar.xz &amp;amp;&amp;amp; \
    tar xvf zephyr-sdk-0.16.1_linux-x86_64.tar.xz &amp;amp;&amp;amp; \
    mv zephyr-sdk-0.16.1 /opt/zephyr-sdk &amp;amp;&amp;amp; \
    cd /opt/zephyr-sdk &amp;amp;&amp;amp; \
    ./setup.sh -t all -h -c &amp;amp;&amp;amp; \
    rm /zephyr-sdk-0.16.1_linux-x86_64.tar.xz

#initialize west
RUN west init -m https://github.com/nrfconnect/sdk-nrf --mr v2.4.0 &amp;amp;&amp;amp; \
    west update&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Then afterwards in the build script, before I do anything, I do&amp;nbsp;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;west&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;update&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;west&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;zephyr-export&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;lt;---- do whatever here, like get code from git or whatever ---&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;west&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;build&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Previously I had these commands before the &amp;quot;west update&amp;quot; command, but they caused my default builder to go to waste, as I needed to use the NCS shell to get anything done. These lines break the builder&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="golang"&gt;# RUN wget https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-23-2/nrf-command-line-tools_10.23.2_amd64.deb &amp;amp;&amp;amp; \
#  dpkg -i nrf-command-line-tools_10.23.2_amd64.deb &amp;amp;&amp;amp; \
#  rm /nrf-command-line-tools_10.23.2_amd64.deb

# RUN dpkg --unpack /opt/nrf-command-line-tools/share/JLink_Linux_V788j_x86_64.deb \
#  &amp;amp;&amp;amp; rm -f /var/lib/dpkg/info/jlink.postinst \
#  &amp;amp;&amp;amp; dpkg --configure jlink \
#  &amp;amp;&amp;amp; apt install -yf \
#  &amp;amp;&amp;amp; rm -f /opt/nrf-command-line-tools/share/JLink_Linux_V788j_x86_64.deb

# RUN wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil -O /usr/local/bin/nrfutil &amp;amp;&amp;amp; \
#  chmod +x /usr/local/bin/nrfutil

# RUN nrfutil install toolchain-manager &amp;amp;&amp;amp; \
#  nrfutil toolchain-manager install --ncs-version v2.4.0 &amp;amp;&amp;amp; \
#  nrfutil toolchain-manager launch --shell &amp;amp;&amp;amp; \&lt;/pre&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I think this issue is related in somewhat to this legacy issue&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/90902/nanopb-and-zephyr-sdk-toolchain-in-ncs-v2-0-x"&gt;NanoPB and Zephyr SDK toolchain in NCS v2.0.x - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&amp;nbsp;- I guess it was never really fixed&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/459251?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 18:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c047c1e9-5c07-4ae0-81ed-9f8602ad3c22</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;thanks for reproducing that is very helpful to know that its not specific to my system&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/459250?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 18:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbe114c6-54af-4ddb-a64b-082a75f084e9</guid><dc:creator>JRPC</dc:creator><description>&lt;p&gt;I can reproduce the exact same issue.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If I use west -build directly from my console, I get the following output:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;-- west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /nrf/applications/Riverrock
-- CMake version: 3.22.2
-- Using NCS Toolchain 2.4.0 for building. (/root/ncs/toolchains/1f9b40e71a/cmake)
CMake Error at /usr/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python3 (missing: Interpreter) (Required is exact version
&amp;quot;3.8&amp;quot;)

Reason given by package:
Interpreter: Cannot run the interpreter &amp;quot;/root/ncs/toolchains/1f9b40e71a/usr/local/bin/python3&amp;quot;

Call Stack (most recent call first):
/usr/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.22/Modules/FindPython/Support.cmake:3166 (find_package_handle_standard_args)
/usr/local/share/cmake-3.22/Modules/FindPython3.cmake:490 (include)
/zephyr/cmake/modules/python.cmake:46 (find_package)
/zephyr/cmake/modules/zephyr_default.cmake:115 (include)
/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/opt/venv/bin/python3.8 -B/nrf/applications/Riverrock/build -GNinja -DBOARD=iotex_pebble_hw30ns -S/nrf/applications/Riverrock&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if I try to use the nrfutil toolchain manager console, I get this:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;-- west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /nrf/applications/Riverrock
-- CMake version: 3.20.5
-- Using NCS Toolchain 2.4.0 for building. (/root/ncs/toolchains/1f9b40e71a/cmake)
-- Found Python3: /root/ncs/toolchains/1f9b40e71a/usr/local/bin/python3 (found suitable exact version &amp;quot;3.8.2&amp;quot;) found components: Interpreter
-- Cache files will be written to: /root/.cache/zephyr
-- Zephyr version: 3.3.99 (/zephyr)
-- Found west (found suitable version &amp;quot;1.0.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: iotex_pebble_hw30ns
-- Found host-tools: zephyr 0.16.0 (/root/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.0 (/root/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk)
-- Found Dtc: /root/ncs/toolchains/1f9b40e71a/usr/local/bin/dtc (found suitable version &amp;quot;1.4.7&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found BOARD.dts: /nrf/boards/arm/iotex_pebble_hw30/iotex_pebble_hw30ns.dts
-- Generated zephyr.dts: /nrf/applications/Riverrock/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /nrf/applications/Riverrock/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /nrf/applications/Riverrock/build/zephyr/dts.cmake
Parsing /nrf/applications/Riverrock/Kconfig
/zephyr/scripts/kconfig/kconfig.py: /nrf/applications/Riverrock/Kconfig:64: &amp;#39;/nrf/applications/Riverrock/src/watchdog/Kconfig&amp;#39; not found (in &amp;#39;rsource &amp;quot;src/watchdog/Kconfig&amp;quot;&amp;#39;). Check that environment variables are set correctly (e.g. $srctree, which is set to &amp;#39;/zephyr&amp;#39;). Also note that unset environment variables expand to the empty string.
CMake Error at /zephyr/cmake/modules/kconfig.cmake:339 (message):
command failed with return code: 1
Call Stack (most recent call first):
/nrf/cmake/modules/kconfig.cmake:29 (include)
/zephyr/cmake/modules/zephyr_default.cmake:115 (include)
/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /root/ncs/toolchains/1f9b40e71a/usr/local/bin/cmake -DWEST_PYTHON=/root/ncs/toolchains/1f9b40e71a/usr/local/bin/python3.8 -B/nrf/applications/Riverrock/build -GNinja -DBOARD=iotex_pebble_hw30ns -S/nrf/applications/Riverrock&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;At first glance, I think the reason is that the console sets its own WEST_PYTHON path, and uses it&amp;#39;s own CMAKE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The errors you see in the compilation using the shell are not important, it&amp;#39;s my app&amp;#39;s coding error, but the point is that this issue is valid - west build fails since by default it&amp;#39;s looking in the toolchain by default for Python, which I think should not be the case, unless we are using the toolchain console&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/459235?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 16:20:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7d3baaa-0890-4079-bac1-33f07ca866e8</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;That library is available at that location.&lt;br /&gt;I assume the environment isn&amp;#39;t loading correctly.&lt;br /&gt;Could you tell me what steps you take from a terminal session to compiling one of the samples?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS: CMake unable to execute Python</title><link>https://devzone.nordicsemi.com/thread/459198?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 13:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f5d4aa5-f107-447d-8d21-7774d99ee27f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tried to follow the same instructions on Ubuntu 22.04, but I&amp;#39;m not able to reproduce the behavior you are seeing.&lt;/p&gt;
&lt;p&gt;Can you check that shared library is available? On my setup I see the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bash-5.1$ find /* -name &amp;quot;libpython3.8.so.1.0&amp;quot; -print 2&amp;gt;/dev/null/home/joh2/ncs/toolchains/7795df4459/opt/nanopb/generator-bin/libpython3.8.so.1.0/home/joh2/ncs/toolchains/7795df4459/usr/local/lib/libpython3.8.so.1.0&lt;/pre&gt;If you do not see this file, please try to reinstall the toolchain.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>