Python site packages

Michael Jansen kde at
Sun Jan 20 15:11:54 UTC 2013

On Sunday, January 20, 2013 08:37:28 PM Ben Cooksley wrote:
> On Sun, Jan 20, 2013 at 12:55 PM, Kevin Kofler <kevin.kofler at> wrote:
> > On Saturday 19 January 2013 at 22:33:19, David Faure wrote:
> >> Because this breaks "make install" for developers.
> >> 
> >> (For the recommended case of installing as user rather than as root).
> >> The default should make it easy for everyone who wants to contribute to
> >> KDE.> 
> > But that makes things harder for packagers, for the benefit of the vocal,
> > but very small, minority of users who compile KDE directly from source.
> Are you implying that KDE Developers are a "small minority of users"?
> Do remember that developers have to compile and install the same
> sources as well, and for many reasons most do not want their
> self-compiled version to affect the system in any way. This build
> system change lowers the barrier to entry for KDE Development in my
> view and should be retained.
> It is far easier for packagers (who have experience and the benefits
> of being directly notified of this change) to add a single CMake
> argument to their build scripts than it is for all new developers to
> discover and then use this option. Running into a installation problem
> will just dissuade them and will ultimately harm the KDE Community in
> the long term.
> >         Kevin Kofler

How about we make all of them happy?

First diff:diff --git a/cmake/modules/FindPythonLibrary.cmake b/cmake/modules/FindPythonLibrary.cmake
index 7cef79b..7e36347 100644
--- a/cmake/modules/FindPythonLibrary.cmake
+++ b/cmake/modules/FindPythonLibrary.cmake
@@ -58,8 +58,10 @@ if (PYTHONINTERP_FOUND)
-            CACHE PATH "The directory where Python modules will be installed to.")
+        execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))"
+                       )
         message(STATUS "The Python files will be installed to ${PYTHON_SITE_PACKAGES_INSTALL_DIR}. Make sure to add them to the Python search path (e.g. by setting PYTHONPATH)")

This should fix the problem with site/dist-packages.

Together with:

sysconfig.get_config_vars( 'base' ) or 'prefix'

it should even be able to only print the warning "The Python ...." if CMAKE_INSTALL_PREFIX ist different from the python PREFIX.

Sorry. Just had enough time to research the problem. Not enough time to do the change and a review request. Perhaps someone else can pick up here.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the release-team mailing list