您的位置:首页 > 编程语言 > Python开发

annocoda3安装的python环境下,配置opencv3

2017-12-19 10:50 543 查看
首先,查看所用python的安装路径which python,定位到python的安装路径。

然后修改相应的opencv的配置命令,安装应用在python3下的opencv的安装教材可参考这儿

annocoda3需要的配置命令为:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D PYTHON3_EXECUTABLE=/home/jinx/anaconda3/bin/python3 \
-D PYTHON3_INCLUDE_DIR=/home/jinx/anaconda3/include/python3.6m \
-D PYTHON3_LIBRARY=/home/jinx/anaconda3/lib/libpython3.6m.so \
-D PYTHON3_NUMPY_INCLUDE_DIRS=/home/jinx/anaconda3/lib/python3.6/site-packages/numpy/core/include ..


踩坑记录:

1 在编译过程中出现了TIFFIsTiled@LIBTIFF_4.0的错误

这需要在cmake的时候加上

-D BUILD_TIFF=ON \


这个问题参考这儿

如果出现各种错误,不要担心,直接找到对应的error,总有人踩过的。

2 出现NPY_INTERNAL_BUILD错误

First of all change the directory to ".../site-packages/numpy/core/include/numpy"

Then use ls command.

open file npy_common.h and change the line

#if NPY_INTERNAL_BUILD to #ifndef NPY_INTERNAL_BUILD

write following command

#define NPY_INTERNAL_BUILD just after #ifndef NPY_INTERNAL_BUILD


参考这儿
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息