我正在尝试将 pyopencv 安装到使用 --no-site-packages 选项创建的 virtualenv:
pip install pyopencv
但我在 Ubuntu 10.04.3 上遇到以下错误:
CMake Error at CMakeLists.txt:186 (find_package):
Could not find a configuration file for package OpenCV.
Set OpenCV_DIR to the directory containing a CMake configuration file for
OpenCV. The file will have one of the following names:
OpenCVConfig.cmake
opencv-config.cmake
我已经安装了 numpy、scipy 和 OpenCV (libboost-dev libboost-python1.40.0 libboost-python1.40-dev cmake libcv4 libcv-dev libcvaux4 libcvaux-dev)。有什么想法吗?
PS 我知道有预构建的 Ubuntu 包 python-opencv,但我不知道如何使用 --no-site-packages 将它安装到 virtualenv 中(可能符号链接(symbolic link)会起作用,但它很难看...... ).
最佳答案
将这两行添加到/etc/bash.bashrc(或者只是在命令提示符下运行)修复问题。
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
也请遵循此处的说明:https://github.com/ingenuitas/SimpleCV#installation
关于python - 使用 --no-site-packages 在 virtualenv 中安装 pyopencv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8434919/