未找到 CMAKE 中的 Python_LIBRARIES

标签 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)。我必须改变任何线路吗?

谢谢。

最佳答案

首先安装 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 命令的参数

关于未找到 CMAKE 中的 Python_LIBRARIES,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38842019/

相关文章:

python - 使用 MySQL Connector 和 Python 3 在 Django 中运行 inspectdb 时出错

python - Celeryd 忽略/etc/default/celeryd 中的 BROKER_URL

c++ - 在 cmake 中,如何指定 qt5 pacakge 路径

python - 嵌套列表中第一个值的总和

python - 合并重叠的日期时间间隔

python - 是否有任何计算机语言知道检查不存在的变量和检查是否存在之间的区别?

c++ - 尽管找到了 cuda,CMAKE_CUDA_COMPILER 标志仍为 false

c++ - CMake 设置默认资源/ Assets 目录

cmake - 如何在 CMake 中使用 LD_PRELOAD 调用编译器

c++ - CMake 和 lcov : gcno files not found