Skip to content

FindPython's Development.Module component requires "LIBRARY" in the artifacts list

In my current environment find_package(Python REQUIRED COMPONENT Development.Module) currently fails with Could NOT find Python (missing: Development.Module). The reason for this failure can be traced through the following parts of the code:

  • LIBRARY is currently only added to _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS) on Windows
  • Without LIBRARY in that list, we never enter this conditional block
  • Without entering that block, we never call _python_get_version
  • Without that function call, we don't have all the variables set for this conditional, which in turn means that we don't set ${_PYTHON_PREFIX}_Development.Module_FOUND to TRUE.

I am not sure why the addition of LIBRARY is inside a Windows-specific conditional, and I don't know if removing it causes issues in non-Windows environments other than my own, but I can confirm that removing it fixes my issue (!7406 (closed) contains that proposed fix). If that fix is problematic, I could use some guidance on what alternate path the code is supposed to follow on my non-Windows system in order to correctly find the desired component. I'm happy to provide any additional context for debugging.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information