# Could NOT find Python: unsuitable version

**URL:** https://discourse.cmake.org/t/could-not-find-python-unsuitable-version/7759
**Category:** Usage
**Tags:** os:windows
**Created:** [March 23, 2023, 11:42pm UTC](https://discourse.cmake.org/t/could-not-find-python-unsuitable-version/7759 "2023-03-23T23:42:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Teancum\_Quist](https://discourse.cmake.org/user_avatar/discourse.cmake.org/teancum_quist/32/3285_2.png) [@Teancum\_Quist](https://discourse.cmake.org/u/Teancum_Quist)
#### Post date: [March 23, 2023, 11:42pm UTC](https://discourse.cmake.org/t/could-not-find-python-unsuitable-version/7759/1 "2023-03-23T23:42:48Z")

</div>

I’m trying to build this piece of code using cmake, but I keep getting an error that it can’t find python, or I have the wrong version. I only have one python distribution. 3.10, it is in my path. I highlighted below where it says I have version “…” installed, but not 3. I’m not sure what is causing all these errors. I also have a thread failure highlighted, I’m not even sure what that is. Sorry, I don’t typically use cmake. Any help would be greatly appreciated.  
Thank you

C:\COMP167\mcnptools\>cmake -D CMAKE\_INSTAL\_PREFIX=D:\MY\_MCNP\MCNPTOOLS -D mcnptools.python\_install=User C:\COMP167\mcnptools -D Python\_EXECUTABLE=C:\Users\Teancum\AppData\Local\Programs\Python\Python310 -D Python\_LIBRARY=C:\Users\Teancum\AppData\Local\Programs\Python\Python310\Lib -D Python\_INCLUDE\_DIR=C:\Users\Teancum\AppData\Local\Programs\Python\Python310  
– Building for: Visual Studio 15 2017  
CMake Deprecation Warning at CMakeLists.txt:3 (cmake\_policy):  
The OLD behavior for policy CMP0076 will be removed from a future version  
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all  
policies are deprecated and that a policy should be set to OLD only under  
specific short-term circumstances. Projects should be ported to the NEW  
behavior and not rely on setting a policy to OLD.

– The C compiler identification is MSVC 19.16.27031.1  
– The CXX compiler identification is MSVC 19.16.27031.1  
– Detecting C compiler ABI info  
– Detecting C compiler ABI info - done  
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped  
– Detecting C compile features  
– Detecting C compile features - done  
– Detecting CXX compiler ABI info  
– Detecting CXX compiler ABI info - done  
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped  
– Detecting CXX compile features  
– Detecting CXX compile features - done  
– Could NOT find Python (missing: Interpreter)  
– Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD  
_ **– Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD - Failed** _  
– Looking for pthread\_create in pthreads  
– Looking for pthread\_create in pthreads - not found  
– Looking for pthread\_create in pthread  
– Looking for pthread\_create in pthread - not found  
– Found Threads: TRUE  
– Found Git: C:/Program Files/Git/cmd/git.exe (found version “2.26.0.windows.1”)  
– Attempting to find CMake-built HDF5  
CMake Warning at dependencies/shacl-F5\_CXX/indirection\_.cmake:1 (\_find\_package):  
Could not find a configuration file for package “HDF5” that is compatible  
with requested version “”.

The following configuration files were considered but not accepted:

```
C:/Program Files/HDF_Group/HDF5/1.14.0/cmake/hdf5-config.cmake, version: 1.14.0 (64bit)

```

Call Stack (most recent call first):  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
dependencies/shacl-F5\_CXX/indirection.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
dependencies/shacl-F5\_CXX/CMakeLists.txt:63 (find\_package)

– Attempting to find makefile-built HDF5  
– Found HDF5: C:/Program Files/HDF\_Group/HDF5/1.14.0/lib/hdf5.lib (found version “1.14.0”) found components: C  
– Found HDF5. Version = 1.14.0, Is Parallel? = FALSE  
– No MPI parallel HDF5 found. Building serial library  
CMake Warning at utils/CMakeLists.txt:19 (message):  
libtiff not found…not building mctal2rad

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:706 (file):  
file STRINGS file  
“C:\Users\Teancum\AppData\Local\Programs\Python\Python310/patchlevel.h”  
cannot be read.  
Call Stack (most recent call first):  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (_python\_get\_version)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (_find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/CMakeLists.txt:7 (find\_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:711 (list):  
list GET given empty list  
Call Stack (most recent call first):  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (_python\_get\_version)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (_find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/CMakeLists.txt:7 (find\_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:712 (list):  
list GET given empty list  
Call Stack (most recent call first):  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (_python\_get\_version)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (_find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/CMakeLists.txt:7 (find\_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:713 (list):  
list GET given empty list  
Call Stack (most recent call first):  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (_python\_get\_version)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (_find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/CMakeLists.txt:7 (find\_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:225 (set):  
Syntax error in cmake code at

```
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:225

```

when parsing string

```
Could NOT find Python: ***Found unsuitable version "..", but required is at least "3**"* (found C:\Users\Teancum\AppData\Local\Programs\Python\Python310, )

```

Invalid character escape ‘\U’.  
Call Stack (most recent call first):  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA\_FAILURE\_MESSAGE)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3766 (find\_package\_handle\_standard\_args)  
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (_find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/indirection_\_\_\_\_\_\_\_\_\_\_\_.cmake:1 (find\_package)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/call.cmake:9 (include)  
dependencies/shacl-F5\_CXX/.cmake/FunctionExtension/find\_package.cmake:21 (call)  
dependencies/shacl-F5\_CXX/.cmake/Git/Submodule/Packages/find\_package.cmake:20 (previous\_find\_package)  
python/CMakeLists.txt:7 (find\_package)

– Configuring incomplete, errors occurred!

---

<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: [March 24, 2023, 8:01am UTC](https://discourse.cmake.org/t/could-not-find-python-unsuitable-version/7759/2 "2023-03-24T08:01:34Z")

</div>

First remark: specify paths on the command line using slashes rather than backslashes because these paths are `CMake` paths and `CMake` use the slash as directory separator.

Second, regarding `Python`, if your python was installed from the official site ([python.org](http://python.org)) you don’t have to specify anything because `CMake` will localize it using registry information. And even if you install `Python` in some specific way and there is no registry information, if `Python` interpreter is in your `PATH`, again nothing is required to be specified on the command line.
