Ausführen von OpenCV aus einer Python-Virtualenv

Ich versuche, OpenCV innerhalb eines virtuellen Computers auf meinem Ubuntu Server 12.04 zu installieren. ich fandEin Thread, der dies diskutiert aber es gelang, keine Informationen daraus zu extrahieren.

Ich habe versucht mitpip install pyopencv aber es ist fehlgeschlagen.

...
package/extras/core/ndarray.cpp:598:1:   instantiated from here

package/extras/core/ndarray.cpp:546:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_intptr_t {aka long int}’ [-Wformat]

package/extras/core/ndarray.cpp: In function ‘boost::python::api::object sdcpp::from_ndarray_impl(const sdcpp::ndarray&) [with T = cv::Scalar_<double>]’:

package/extras/core/ndarray.cpp:601:1:   instantiated from here

package/extras/core/ndarray.cpp:546:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_intptr_t {aka long int}’ [-Wformat]

package/extras/core/ndarray.cpp: In function ‘boost::python::api::object sdcpp::from_ndarray_impl(const sdcpp::ndarray&) [with T = cv::Range]’:

package/extras/core/ndarray.cpp:604:1:   instantiated from here

package/extras/core/ndarray.cpp:546:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_intptr_t {aka long int}’ [-Wformat]

error: command 'gcc' failed with exit status 1

Dieser Fehler tritt nur beim zweiten Ausführen aufpip install. Wenn ich den Rest löschebuild/ Ordner bekomme ich diesen Fehler.

-- Configuring incomplete, errors occurred!

Configuring PyOpenCV via CMake...

Error: error occurred while running CMake to configure PyOpenCV.

You may want to manually configure PyOpenCV by running cmake's tools:

    mkdir build

    cd build

    cmake-gui ..    OR    cmake ..

    cd ..

----------------------------------------
Command python setup.py egg_info failed with error code 255

Ich habe mindestens die folgenden Apt-Pakete installiert.

build-essential
uuid-dev
python-dev
python-pip
libpq-dev
cmake
libboost-dev
libcv-dev
libcvaux-dev
libboost-python-dev
libboost1.48-dev

Wie kann ich OpenCV in meiner virtuellen Umgebung installieren?

Antworten auf die Frage(3)

Ihre Antwort auf die Frage