# FindPython3 behaves differently with every little change in CMakeLists.txt

**URL:** https://discourse.cmake.org/t/findpython3-behaves-differently-with-every-little-change-in-cmakelists-txt/7684
**Category:** Usage
**Tags:** os:windows
**Created:** [March 15, 2023, 6:16pm UTC](https://discourse.cmake.org/t/findpython3-behaves-differently-with-every-little-change-in-cmakelists-txt/7684 "2023-03-15T18:16:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tricostume](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tricostume](https://discourse.cmake.org/u/tricostume)
#### Post date: [March 15, 2023, 6:16pm UTC](https://discourse.cmake.org/t/findpython3-behaves-differently-with-every-little-change-in-cmakelists-txt/7684/1 "2023-03-15T18:16:18Z")

</div>

I am trying to use the next piece of cmake code:

#set(Python3\_FIND\_STRATEGY LOCATION)  
#set(Python3\_FIND\_REGISTRY FIRST)  
#set(Python3\_FIND\_VIRTUALENV FIRST)  
find\_package(Python3 COMPONENTS Interpreter Development REQUIRED)

The three commented lines it just does not matter how to activate them, sometimes it works and when adding a MESSAGE(STATUS …) then it stops finding Python3. Why does it stop findig Python3 with every little change in the CMakeLists.txt?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 16, 2023, 6:05pm UTC](https://discourse.cmake.org/t/findpython3-behaves-differently-with-every-little-change-in-cmakelists-txt/7684/2 "2023-03-16T18:05:27Z")

</div>

Does `cmake --find-debug` help at all?

Cc: @marc.chevrier
