ModuleNotFoundError: No module named 'yaml' error in CLion

Hello,

I am currently trying to set up Zephyr in Cmake on Windows 10 but I am getting the following error:

"E:\Programs\clion\CLion 2022.3.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=ZRelease "-DCMAKE_MAKE_PROGRAM=E:/Programs/clion/CLion 2022.3.2/bin/ninja/win/x64/ninja.exe" -G Ninja -S E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\app -B E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\app\cmake-build-zrelease
INFOdts folder found in: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/drivers
Loading Zephyr default modules (Zephyr workspace).
-- Application: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app
-- Found Python3: C:/Users/Svetlio/AppData/Local/Programs/Python/Python311/python.exe (found suitable exact version "3.11.2") found components: Interpreter 
-- Cache files will be written to: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/.cache
-- Zephyr version: 3.2.0 (E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr)
-- Board: nrf52dk_nrf52832
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.15.2 (C:/Users/Svetlio/zephyr-sdk-0.15.2)
-- Found toolchain: zephyr 0.15.2 (C:/Users/Svetlio/zephyr-sdk-0.15.2)
-- Found Dtc: C:/ProgramData/chocolatey/bin/dtc.exe (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts
Traceback (most recent call last):
  File "E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\zephyr\scripts\dts\gen_defines.py", line 33, in <module>
    from devicetree import edtlib
  File "E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\zephyr\scripts\dts\python-devicetree\src\devicetree\edtlib.py", line 76, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'
-- In: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/cmake-build-zrelease/zephyr, command: C:/Users/Svetlio/AppData/Local/Programs/Python/Python311/python.exe;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/scripts/dts/gen_defines.py;--dts;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/cmake-build-zrelease/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/drivers/dts/bindings;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/dts/bindings;--header-out;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/cmake-build-zrelease/zephyr/include/generated/devicetree_generated.h.new;--dts-out;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/cmake-build-zrelease/zephyr/zephyr.dts.new;--edt-pickle-out;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/cmake-build-zrelease/zephyr/edt.pickle;--vendor-prefixes;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/drivers/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/cmake/modules/dts.cmake:230 (message):
  gen_defines.py failed with return code: 1
Call Stack (most recent call first):
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:148 (include_boilerplate)
  CMakeLists.txt:62 (find_package)

I reinstalled python, tried installing  python -m pip install pyyaml but it's already installed.

Read in some ticket that for MacOS the problem can be solved by commenting in python.cmake the last two lines:

#find_package(Python3 ${PYTHON_MINIMUM_REQUIRED} REQUIRED ${PYTHON_EXACT})
#set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})

But when I did that I get the following error:
"E:\Programs\clion\CLion 2022.3.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=ZDebug "-DCMAKE_MAKE_PROGRAM=E:/Programs/clion/CLion 2022.3.2/bin/ninja/win/x64/ninja.exe" -G Ninja -S E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\app -B E:\TUES_Fontys\Fontys\S8\software\CLionProjects\template\app\cmake-build-zdebug
INFOdts folder found in: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app/drivers
Loading Zephyr default modules (Zephyr workspace).
-- Application: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/app
-- Cache files will be written to: E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/.cache
-- Zephyr version: 3.2.0 (E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr)
-- Board: nrf52dk_nrf52832
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.15.2 (C:/Users/Svetlio/zephyr-sdk-0.15.2)
-- Found toolchain: zephyr 0.15.2 (C:/Users/Svetlio/zephyr-sdk-0.15.2)
CMake Error at E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/cmake/modules/FindDtc.cmake:41 (find_package_handle_standard_args):
  Unknown CMake command "find_package_handle_standard_args".
Call Stack (most recent call first):
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/cmake/modules/dts.cmake:9 (find_package)
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  E:/TUES_Fontys/Fontys/S8/software/CLionProjects/template/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:148 (include_boilerplate)
  CMakeLists.txt:62 (find_package)


-- Configuring incomplete, errors occurred!

[Finished]
Related