简体   繁体   English

Opencv2.4.13和PYTHON2_INCLUDE_PATH

[英]Opencv2.4.13 and PYTHON2_INCLUDE_PATH

I used ccmake.. GUI to configure the OpenCV for compilation. 我使用ccmake.. GUI配置OpenCV进行编译。

I like to include Python in Opecv's build process. 我喜欢在Opecv的构建过程中加入Python。 So BUILD_opencv_python is set ON . 因此BUILD_opencv_python设置为ON

But there is no option to set PYTHON2_INCLUDE_PATH in the ccmake GUI for this Opencv2.4.13 cmake. 但是,没有任何选项可以在ccmake GUI中为此Opencv2.4.13 cmake设置PYTHON2_INCLUDE_PATH How can I include that path in compilation? 如何在编译中包含该路径?

If not, I have Python.h not found error . 如果没有,我有Python.h not found error

I have only PYTHON_NUMPY_INCLUDE_DIR and PYTHON_PACKAGES_PATH in the GUI. 我的GUI中只有PYTHON_NUMPY_INCLUDE_DIR and PYTHON_PACKAGES_PATH

I use anaconda2 for Python2.7. 我为Python2.7使用anaconda2。

Python.h exists inside ~/anaconda2/include/python2.7 . Python.h存在于~/anaconda2/include/python2.7 So I copied the file into include folder inside numpy , but still have not found error. 所以我将文件复制到include folder inside numpy ,但仍然没有发现错误。

for PYTHON_NUMPY_INCLUDE_DIR , set the path as the following 对于PYTHON_NUMPY_INCLUDE_DIR ,将路径设置为以下内容

    /path2anaconda/anaconda2/lib/python2.7/site-packages/numpy/core/include

for PYTHON_PACKAGES_PATH , set 对于PYTHON_PACKAGES_PATH ,设置

            /path2anaconda/anaconda2/lib/python2.7/site-packages

it should work after that if there aren't any other errors. 如果没有其他错误,它应该可以正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM