Cmake不能找到Python庫 [英] Cmake is not able to find Python-libraries

查看:15367
本文介紹了Cmake不能找到Python庫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

獲取此錯誤:

sudo: unable to resolve host coderw@ll
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) 
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108     
(message):
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315  
(_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindPythonInterp.cmake:139 
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Code/cmake/Modules/FindNumPy.cmake:10 (find_package)
CMakeLists.txt:114 (find_package)



-- Configuring incomplete, errors occurred!
See also "/home/coderwall/Desktop/rdkit/build/CMakeFiles/CMakeOutput.log".
See also "/home/coderwall/Desktop/rdkit/build/CMakeFiles/CMakeError.log".

我已經安裝:


  1. sudo apt-get install python-dev

  2. 環境變量已設置如下:

  1. sudo apt-get install python-dev
  2. Environment variable are already set as follow:

PYTHON_INCLUDE_DIRS=/usr/include/python2.7 
PYTHON_LIBRARIES=/usr/lib/python2.7/config/libpython2.7.so


的位置python.h /usr/lib/include/python2.7/python.h

位置 python libs: /usr/lib/python2.7 /
如何解決?

Location of python libs: /usr/lib/python2.7/ How to solve this?

推薦答案

當我試圖在Xubuntu 14.04 Thrusty Tahr系統上編譯OpenCV 3時遇到這個問題。
在安裝了所有的Python開發包后,配置過程總是返回以下消息:

I was facing this problem while trying to compile OpenCV 3 on a Xubuntu 14.04 Thrusty Tahr system. With all the dev packages of Python installed, the configuration process was always returning the message:

Could NOT found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable exact version "2.7.6")
Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4", minimum required is "3.4")
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (Required is exact version "3.4.0")

Thrusty Tahr存儲庫上提供的CMake版本是2.8。
一些帖子激勵我升級CMake。
我添加了一個PPA CMake倉庫,安裝CMake版本3.2。

The CMake version available on Thrusty Tahr repositories is 2.8. Some posts inspired me to upgrade CMake. I've added a PPA CMake repository which installs CMake version 3.2.

升級后,一切運行順利,編譯成功。

After the upgrade everything ran smoothly and the compilation was successful.

這篇關于Cmake不能找到Python庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持IT屋!

查看全文
登錄 關閉
掃碼關注1秒登錄
發送“驗證碼”獲取 | 15天全站免登陸
全免费A级毛片免费看无码播放