python wrapper/package 应该安装在哪里

Where should python wrapper/package be installed

我正在分发一个相当大的 C 库;作为分发的一部分是一个 Python 包装器包。构建系统是 cmakemake install 应该将 Python 代码复制到 Python 路径中的某个位置。根据阅读 Python 文档,安装的 Python 模块的默认位置是:

${CMAKE_INSTALL_PREFIX}/lib/pythonX.Y/site-packages

但在基于 Debian 的系统上,此路径不在默认 Python 搜索路径中,而是搜索路径包含 /usr/local/lib/pythonX.Y/dist-packages。我想默认安装到 "just work",想知道关于 dist-packagessite-packages 的最佳方法是什么?我目前的计划是:

  1. 如果在基于 Debian 的系统上 - 安装到 dist-packages
  2. 否则安装到 site-packages

但也许 dist-packages 对于带有包管理器的包?

dist-packages 仅适用于带有包管理器的包。

来自 debian 维基:

dist-packages instead of site-packages. Third party Python software installed from Debian packages goes into dist-packages, not site-packages. This is to reduce conflict between the system Python, and any from-source Python build you might install manually.

打包python个模块,参考Section 2.5

Public Python modules not handled by python-central or python-support must be installed in the system Python modules directory, /usr/lib/pythonX.Y/dist-packages for python2.6 and later, and /usr/lib/pythonX.Y/site-packages for python2.5 and earlier. Public Python 3 modules must be installed in /usr/lib/python3/dist-packages.