Why cv2.so missing after opencv installed?

后端 未结 9 1286
你的背包
你的背包 2020-12-01 01:24

Today I installed opencv 2.4.4 to Ubuntu 12.10

But import cv2 not works.

root@-:~# python
Python 2.7.3 (default, Sep 26 2012, 21:53:58) 
[GCC 4.7.2]          


        
9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 02:03

    I have this problem in my OS X El Capitan.

    I followed the instructions mentioned in this tutorial. Didn't get a successful working install and had the above error of missing cv2.so file in the required folders mentioned and at the python prompt.

    Finally figured that using the virtual python setup was causing trouble. So uninstalled with

    pip install virtualenv virtualenvwrapper
    

    Then ran

    brew link opencv
    

    which threw errors.

    And then followed below steps to resolve the issue.

    First run

    brew link opencv
    

    If it gives an error, try for an automated diagnosis

    brew doctor
    

    brew doctor gives a list of problems that could be leading to errors in installation process.

    To fix problems in case of conflicting files, run to get a list of all actions which will be performed by overwrite without actually performing them.

    To list all files that would be deleted:

      brew link --overwrite --dry-run opencv
    

    followed by this run which will execute the overwrite, assuming you feel that the actions performed by overwrite will take your system to a more stable state.

    To force the link and overwrite all conflicting files:

     brew link --overwrite opencv
    

    This tutorial is a simpler alternative.

提交回复
热议问题