2011-12-08 13 views
14

Estoy tratando de instalar pyopencv a virtualenv creadas con-site-packages --no opción:Instalar pyopencv dentro virtualenv con --no-site-packages

pip install pyopencv 

Pero me estoy siguiente error en Ubuntu 10.04 0.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 

ya he instalado numpy, scipy y OpenCV (libboost-dev-libboost python1.40.0 libboost-python1.40-dev cmake libcv4 libcv-dev libcvaux4 libcvaux-dev). ¿Algunas ideas?

PD Sé que hay un paquete de Ubuntu preconstruido python-opencv, pero no sé cómo instalarlo en virtualenv con --no-site-packages (probablemente el enlace simbólico funcionará, pero es feo ... .).

+0

¿Alguna vez entendiste esto? – xamox

+0

xamox, desafortunadamente no. –

+0

Bien, bien, los mantendré informados si encuentro algo. – xamox

Respuesta

1

Creo que tiene que instalar openCV antes para compilar Python.

+0

No. "--no-site-packages" dice que env no usa ningún paquete de todo el sistema. –

2

Agregar estas dos líneas a /etc/bash.bashrc (o simplemente ejecutar en el símbolo del sistema) soluciona el problema.

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 
export PKG_CONFIG_PATH 

También siga insctuctions aquí: https://github.com/ingenuitas/SimpleCV#installation

0

Pip falta OpenCV en su camino.

Si aún no ha instalado opencv, sudo apt-get install opencv lo arreglará.

1
sudo apt-get build-dep python-opencv 

realidad no va a instalar python-OpenCV, pero va a instalar los paquetes pyopencv no depende de Python. Me parece que apt-get build-dep es un complemento increíble para usar pip dentro de virtualenvs.

0
here, try this, open /etc/ld.so.conf.d/opencv.conf as root with your favourite 
editor say gedit and add this line to it /usr/local/lib 
Reload configuration files created 
sudo ldconfig 
now open /etc/bash.bashrc and add this line 
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 
export PKG_CONFIG_PATH 
then copy these files as below 
sudo cp /usr/local/lib/python2.7/site-packages/cv.so /usr/local/lib/python2.7/dist-packages/cv.so 
And then try testing your openCV. HAPPY CODING 
+0

aquí hay un script de solución completo https://gist.github.com/olupotd/cd0c68f4c84153dffd16/download – Olu

Cuestiones relacionadas