# FindPython does not find Development directory

**URL:** https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066
**Category:** Usage
**Tags:** os:linux
**Created:** [June 20, 2024, 1:15pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066 "2024-06-20T13:15:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AmauryW](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@AmauryW](https://discourse.cmake.org/u/AmauryW)
#### Post date: [June 20, 2024, 1:15pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066/1 "2024-06-20T13:15:20Z")

</div>

Hello,

I have some CMake code that tries to find Python with the following lines

```auto
    _set_default( arg_VERSION 3.9 )
    find_package( Python ${arg_VERSION} COMPONENTS Interpreter Development)

```

However, it fails to find Development directory, but it works if I put manually the path to it after.  
Here is the content of the variables after calling it:

```auto
Python_VERSION: 3.9.18
Python_INCLUDE_DIRS: /usr/include/python3.9
Python_LIBRARY_DIRS: 
Python_Development_FOUND: FALSE
Python_Interpreter_FOUND: TRUE
Python_EXECUTABLE /usr/bin/python3.9

```

I’m on:

- AlmaLinux 9.4,
- CMake 3.27.7,
- Python 3.9.18, with python-devel installed with the same version.

Python executable is in `/usr/bin/python3.9`  
Python include directory in `/usr/include/python3.9`,  
Python library directory in `/usr/lib64/python3.9/`.

Is it a known issue? Do I need to do something to fix it?

Thanks a lot.

---

<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: [June 20, 2024, 1:27pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066/2 "2024-06-20T13:27:58Z")

</div>

I think the problem is related to the `lib64` directory name. In normal situation, this directory is searched but can be controlled by [FIND\_LIBRARY\_USE\_LIB64\_PATHS](https://cmake.org/cmake/help/latest/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.html#prop_gbl:FIND_LIBRARY_USE_LIB64_PATHS) variable. Maybe your `CMake` environment set this variable with the wrong value…

---

<div class="post-metadata">

### Author: ![AmauryW](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@AmauryW](https://discourse.cmake.org/u/AmauryW)
#### Post date: [June 20, 2024, 1:54pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066/3 "2024-06-20T13:54:43Z")

</div>

Thanks for the reply,

It seems that even if I manually force `FIND_LIBRARY_USE_LIB64_PATHS` to true, it still does not work. However, using `CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64` makes it work well, so I will use this for the moment.

Thank you!

---

<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: [June 20, 2024, 2:01pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066/4 "2024-06-20T14:01:37Z")

</div>

Strange. What is your compiler? `lib64` will be searched **only** if your compiler generates 64bit binaries.

---

<div class="post-metadata">

### Author: ![AmauryW](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@AmauryW](https://discourse.cmake.org/u/AmauryW)
#### Post date: [June 20, 2024, 2:39pm UTC](https://discourse.cmake.org/t/findpython-does-not-find-development-directory/11066/5 "2024-06-20T14:39:13Z")

</div>

It’s GCC 11.4.1, but is seems that at the first call to find python, compiler version is still undefined. It looks like the call is not linked to any direct binary generation and is done only to collect information, so I guess that explain the behaviour.

Thank you!
