-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Labels
area: Build SystembugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bugLow impact/importance bug
Description
I have two python 3 installations, but cmake fails to find the correct one after using --pristine build option
To Reproduce
Steps to reproduce the behavior:
- After correctly building a hello world example i used --pristine option to build another example
west build -b sam4e_xpro samples/subsys/usb/cdc_acm --pristine - which caused the following error:
(base) C:\Users\Axel\zephyrproject\zephyr>west -v build -b sam4e_xpro samples/subsys/usb/cdc_acm --pristine
ZEPHYR_BASE=C:\Users\Axel\zephyrproject\zephyr (origin: configfile)
-- west build: generating a build system
cmake version 3.20.1 is OK; minimum version is 3.13.1
Running CMake: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\users\axel\.platformio\penv\scripts\python.exe' '-BC:\Users\Axel\zephyrproject\zephyr\build' '-SC:\Users\Axel\zephyrproject\zephyr\samples\subsys\usb\cdc_acm' -GNinja -DBOARD=sam4e_xpro
Including boilerplate (Zephyr base): C:/Users/Axel/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/Axel/zephyrproject/zephyr/samples/subsys/usb/cdc_acm
-- Zephyr version: 2.5.99 (C:/Users/Axel/zephyrproject/zephyr)
-- Found Python3: C:/ProgramData/Anaconda3/python.exe (found suitable exact version "3.7.1") found components: Interpreter
CMake Error at C:/Users/Axel/zephyrproject/zephyr/cmake/west.cmake:48 (message):
Unable to import west.version from 'C:/ProgramData/Anaconda3/python.exe':
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'west'
Please install with:
C:/ProgramData/Anaconda3/python.exe -m pip install west
Or verify these installations:
The Python version used by west is: c:\users\axel\.platformio\penv\scripts\python.exe (real path C:/Users/Axel/.platformio/penv/Scripts/python.exe)
The Python version used by CMake is: C:/ProgramData/Anaconda3/python.exe
Call Stack (most recent call first):
C:/Users/Axel/zephyrproject/zephyr/cmake/app/boilerplate.cmake:157 (include)
C:/Users/Axel/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
C:/Users/Axel/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\users\axel\.platformio\penv\scripts\python.exe' '-BC:\Users\Axel\zephyrproject\zephyr\build' '-SC:\Users\Axel\zephyrproject\zephyr\samples\subsys\usb\cdc_acm' -GNinja -DBOARD=sam4e_xpro
Expected behavior
Cmake should pick c:\users\axel.platformio\penv\scripts\python.exe as indicated instead it auto selects C:/ProgramData/Anaconda3/python.exe
I made it work by changing manually the cmakecache: PYTHON_PREFER_EXECUTABLE:FILEPATH=c:\users\axel\.platformio\penv\scripts\python.exe after the error is throw, but I have to do it for every new build
Environment (please complete the following information):
- OS: Windows
- Toolchain (gnuarm?)
Metadata
Metadata
Assignees
Labels
area: Build SystembugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bugLow impact/importance bug