I am trying to install pyopencv to virtualenv created with --no-site-packages option:
pip install pyopencv
But I am getting following error on 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
I already installed numpy, scipy and OpenCV (libboost-dev libboost-python1.40.0 libboost-python1.40-dev cmake libcv4 libcv-dev libcvaux4 libcvaux-dev). Any ideas?
PS I know there is pre-built Ubuntu package python-opencv, but I don't know how to install it into virtualenv with --no-site-packages (probably symlink will work, but it is ugly...).
Installing virtualenv venv is included in the Python standard library and requires no additional installation. If you are using venv, you may skip this section. virtualenv is used to manage Python packages for different projects.
We also learned which package to install and how to create a virtual environment for working on the package. For all purposes of learning computer vision using Python, we highly recommend installing opencv-contrib-python using prebuilt binaries.
If you build with virtualenv --system-site-packages ENV , your virtual environment will inherit packages from /usr/lib/python2. 7/site-packages (or wherever your global site-packages directory is).
With the default settings, venv will install both pip and setuptools. Using pip is the recommended way to install packages in Python, and setuptools is a dependency for pip . Because installing other packages is the most common use case for Python virtual environments, you'll want to have access to pip .
Adding this two lines to /etc/bash.bashrc (or just run in command prompt) fix problem.
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
Also follow insctuctions here: https://github.com/ingenuitas/SimpleCV#installation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With