CMAKE中的Python_LIBRARIES未发现

时间:2016-08-09 04:22:51

标签: python cmake

我安装了Qt5和python,用它​​来编译使用CMAKE的Sigil。

首先我遇到qt5的问题,但我解决了设置CMAKE_PREFIX_PATH的问题。 但Python似乎有pythonlibs和PYTHON_LIBRARIES的问题。

首先用黑色字母读:

Looking for python version '3.4' by checking executables: python;python3;python3.4.
Found executable C:/Users/usuario pc/AppData/Local/Programs/Python/Python35-32/python.exe with UNsuitable version 3.5.2
Looking for python version '3.5' by checking executables: python;python3;python3.5.
Found executable C:/Users/usuario pc/AppData/Local/Programs/Python/Python35-32/python.exe with suitable version 3.5.2
Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES) (found suitable version "3.5.2", minimum required is "3.4")

最后用红色字母表示:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.  
Please set them or make sure they are set and tested correctly in the CMake files:  
    PYTHON_LIBRARY (ADVANCED)
linked by target "Sigil" in directory D:/Archivos de Programa/Sigil-0.9.6/src

我是否必须重新安装python? (我做了并重新启动了PC)。我必须改变任何一条线吗?

感谢。

3 个答案:

答案 0 :(得分:0)

我有同样的问题并通过安装python依赖项来解决它,如Sigil linux build instructions中所述: sudo apt-get install python3-dev python3-pip python3-tk python3-lxml python3-six

答案 1 :(得分:0)

首先使用

安装python-dev或python3-dev
sudo apt-get install python-dev

sudo apt-get install python3-dev

然后添加-D PYTHON_LIBRARIES=<where that libpython<version>m.so is located there>作为cmake命令的参数

答案 2 :(得分:0)

sudo apt-get install python3-dev python3-pip python3-tk python3-lxml python3-six

为我工作;)