# \[Question\] Python not found during compilation

**URL:** https://discourse.itk.org/t/question-python-not-found-during-compilation/6580
**Category:** Beginner Questions
**Tags:** github, cmake, simpleitk, python
**Created:** [April 17, 2024, 9:19am UTC](https://discourse.itk.org/t/question-python-not-found-during-compilation/6580 "2024-04-17T09:19:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Suzaku](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@Suzaku](https://discourse.itk.org/u/Suzaku)
#### Post date: [April 17, 2024, 9:19am UTC](https://discourse.itk.org/t/question-python-not-found-during-compilation/6580/1 "2024-04-17T09:19:32Z")

</div>

## Hi, I’m trying to compile SimpleITK with SimpleElastix in a ubuntu 20.04.6 LTS system. I’ve used the following command as suggested in the documentation:

## git clone [GitHub - SimpleITK/SimpleITK: SimpleITK: a layer built on top of the Insight Toolkit (ITK), intended to simplify and facilitate ITK's use in rapid prototyping, education and interpreted languages.](https://github.com/SimpleITK/SimpleITK.git) mkdir SimpleITK-build cd SimpleITK-build cmake -DSimpleITK\_USE\_ELASTIX=ON -DWRAP\_PYTHON:BOOL=ON -DPython\_EXECUTABLE=‘which python3’ ../SimpleITK/SuperBuild/ make -j$(nproc)

## Note that I only changed the cmake line just to make sure it compile SimpleElastix and the python wheel. However, every time I try this I always get the same error:

## Could NOT find Python (missing: Interpreter Development.Module) (found version “3.8.10”)

## I don’t understand what went wrong as I only have one python3 installed in the system which is python3.8.10 (and I already have installed the python-dev in it’s newest version 3.8.2-0ubuntu2). Dispite I’ve already told cmake where to find it, cmake didn’t seem to have understood? I’ve tried days and still couldn’t solve this problem, anyone have a solution could really save me from my boss. Many thanks!!! (I attach the full version of the error message below)

[70%] Completed ‘Elastix’  
[76%] Built target Elastix  
[77%] Performing configure step for ‘SimpleITK’  
Not searching for unused variables given on the command line.  
loading initial cache file /home/cedric/Documents/lib/SimpleITK-build/SimpleITK-build/CMakeCacheInit.txt  
– Building SimpleITK version “2.4.0.dev142-gc7aa7”  
– Processing json files…  
– Processing json files…done  
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):  
Could NOT find Python (missing: Interpreter Development.Module) (found  
version “3.8.10”)  
Call Stack (most recent call first):  
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (\_FPHSA\_FAILURE\_MESSAGE)  
/usr/share/cmake-3.16/Modules/FindPython.cmake:347 (find\_package\_handle\_standard\_args)  
Wrapping/Python/CMakeLists.txt:7 (find\_package)

– Configuring incomplete, errors occurred!  
See also “/home/cedric/Documents/lib/SimpleITK-build/SimpleITK-build/CMakeFiles/CMakeOutput.log”.  
See also “/home/cedric/Documents/lib/SimpleITK-build/SimpleITK-build/CMakeFiles/CMakeError.log”.  
make[2]: \*\*\* [CMakeFiles/SimpleITK.dir/build.make:112 : SimpleITK-prefix/src/SimpleITK-stamp/SimpleITK-configure] Erreur 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:127 : CMakeFiles/SimpleITK.dir/all] Erreur 2  
make: \*\*\* [Makefile:84 : all] Erreur 2

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [April 17, 2024, 1:03pm UTC](https://discourse.itk.org/t/question-python-not-found-during-compilation/6580/2 "2024-04-17T13:03:15Z")

</div>

Hello,

Please ensure that you have the ubuntu package “python3.8-dev” installed. You can this by verifying that “python3.8-config” is installed. Also verify that python3 really is 3.8.

Also I have sometimes seem the FindPython module get confused if there are newer version of python available in the path that don’t have the dev/development module.

You could also try building the package in a docker to isolate issues and have the environment reproducible.
