Cmake无法配置:Python解释器(2.7.15)和库(2.7.13)之间的版本不匹配

2024-06-09 16:51:17 发布

您现在位置:Python中文网/ 问答频道 /正文

最近我对我的ubuntu18.04做了一个更新,我注意到python是从2.7.13更新的(去年在ubuntu安装之后由apt-get install python安装的,如果我现在这样做,我将得到2.7.15)。但是,当我为cern根软件进行配置时,我得到:

-- Looking for python
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:480 (message):
  Version mismatch between Python interpreter (2.7.15) and libraries
  (2.7.13).

  ROOT cannot work with this configuration.  Please specify only
  PYTHON_EXECUTABLE to CMake with an absolute path to ensure matching
  versions are found.

我尝试过:cmake-DPYTHON_LIBRARY=$(python config--prefix)/lib/libpython2.7.dylib-DPYTHON_INCLUDE_DIR=$(python config--prefix)/INCLUDE/python2.7 结果表明:

^{pr2}$

我认为这应该是由python-2.7.15不匹配引起的问题 解释器和python-2.7.13库。我想知道如何通过将python库设置为2.7.15或将解释器设置为2.7.13来修复它?在


Tags: installtocmakeconfiggetprefix软件include