# Could NOT find Python3 (missing: Python3\_LIBRARIES Development Development.Embed) (found suitable version "3.11.2", minimum required is "3.5")

**URL:** https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837
**Category:** Usage
**Tags:** os:windows
**Created:** [April 5, 2023, 9:54pm UTC](https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837 "2023-04-05T21:54:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![trayres](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@trayres](https://discourse.cmake.org/u/trayres)
#### Post date: [April 5, 2023, 9:54pm UTC](https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837/1 "2023-04-05T21:54:35Z")

</div>

Hello everyone! I cannot get CMake to find my Python libraries; I’m getting this error.

I’m on MSYS2 on Windows 10 (which I think might be part of the problem).

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [April 6, 2023, 10:00am UTC](https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837/2 "2023-04-06T10:00:20Z")

</div>

Indeed, `MSYS2` environment should be used coherently (i.e. all tools must be from the same environment).

First question: what do you want to use: `MSYS2` or `MINGW64`? (i.e. what is the value of environment variable `MSYSTEM`?).

If it is `MSYS2`, you **must** use the `cmake` tool provided by this environment (other `cmake` tools will not work as expected) and also use the python from this environment (typical packages `msys/cmake`, `msys/python` and `msys/python-devel`).

If it is `MINGW64`, you can use `Windows` `cmake` or `MNGW64` `cmake` (package `mingw64/mingw-w64-x86_64-cmake`) but you must have consistency between python and the compiler: use Microsoft compiler with standard python (from `python.org`) or use `GNU` `gcc` with python provided by `MINGW64` environment (package `mingw64/mingw-w64-x86_64-python`).

---

<div class="post-metadata">

### Author: ![trayres](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@trayres](https://discourse.cmake.org/u/trayres)
#### Post date: [April 6, 2023, 4:52pm UTC](https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837/3 "2023-04-06T16:52:22Z")

</div>

Hi Marc!  
I’m actually using CLANG64 - it looks like CMake can find the wrong Python interpreter if you have multiple ones installed (clang64/python3, msys/python3).

Even though the clang python was first in my path, CMake ignored the following options to continue to find the wrong Python:  
PYTHON3\_EXECUTABLE  
PYTHON3\_INCLUDE\_DIR  
PYTHON3\_LIBRARY  
PYTHON\_EXECUTABLE  
PYTHON\_INCLUDE\_DIR  
PYTHON\_LIBRARY

In the end, I uninstalled msys/python, forcing CMake to find the correct Python, and all was well. It was extremely frustrating.

I wonder if it is some mistake of mine, in the project I was building, or if it was an issue with CMake.

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [April 6, 2023, 5:21pm UTC](https://discourse.cmake.org/t/could-not-find-python3-missing-python3-libraries-development-development-embed-found-suitable-version-3-11-2-minimum-required-is-3-5/7837/4 "2023-04-06T17:21:25Z")

</div>

If you want to specify a `Hint` variable, use the correct one!

If you request `Python3` package, `Python3_EXECUTABLE` can be specified. Case is important, `PYTHON3` in uppercase is not correct. And the same of `PYTHON` or `Python` which are irrelevant in this case.  
If you request `Python` package, `Python_EXECUTABLE` can be used, nothing else!

And specifying the executable is enough, all other artifacts are deduced from the interpreter itself.

And to finish, without a full snippet showing exactly what are the variables you have defined and how you call the `find_package`, hard to say more…
