2011-12-08 47 views
14

我試圖安裝pyopencv到VIRTUALENV與--no-站點包選項創建:內的virtualenv安裝pyopencv與--no-站點包

pip install pyopencv 

但我在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 

我已經安裝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中(可能符號鏈接可以工作,但它很醜。 )。

+0

你有沒有得到這個想通了? – xamox

+0

xamox,不幸的是沒有。 –

+0

好吧,如果我能遇到什麼,我會保持張貼。 – xamox

回答

1

我認爲你必須在構建python包裝器之前安裝openCV。

+0

編號「--no-site-packages」表示env不使用任何系統級軟件包。 –

2

將這兩行添加到/etc/bash.bashrc(或者只是在命令提示符下運行)修復問題。

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

也跟着insctuctions這裏:https://github.com/ingenuitas/SimpleCV#installation

0

匹普是在您的路徑缺少的OpenCV。

如果您還沒有安裝OpenCV的又一個sudo apt-get install opencv會解決這個問題。

1
sudo apt-get build-dep python-opencv 

實際上不會安裝python-opencv,但會安裝pyopencv依賴的非Python包。我發現apt-get build-dep是在virtualenvs中使用pip的一個很好的補充。

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

這是一個完整的解決方案腳本https://gist.github.com/olupotd/cd0c68f4c84153dffd16/download – Olu

相關問題