代码之家  ›  专栏  ›  技术社区  ›  Rajat jain

importError:libopencv_hdf.so.3.1:无法打开共享对象文件:没有此类文件或目录

  •  0
  • Rajat jain  · 技术社区  · 8 年前

    我正试图在BitBucket管道中运行我的测试用例,但它显示 一条错误消息。

    bitback-pipeline.yml的屏幕截图

    enter image description here

    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    >   import cv2
    E   ImportError: libopencv_hdf.so.3.1: cannot open shared object file: No such file or directory
    
    **ImportError**
    
    2 回复  |  直到 8 年前
        1
  •  1
  •   Rajat jain    8 年前

    谢谢,我找到了答案。我在安装OpenCV冗余时间,所以它重叠并从自身删除了一些重要模块。 这是我的bitback-pipeline.yml脚本

        image: python:3.6.2
    pipelines:
      default:
        - step:
            caches:
              - condacache
            script:
              - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
              - chmod +x Miniconda3-latest-Linux-x86_64.sh
              - ./Miniconda3-latest-Linux-x86_64.sh -u -b -p /opt/python
              - cd marvin_oms
              - /opt/python/bin/conda update -y conda
              - /opt/python/bin/pip install --upgrade pip
              - /opt/python/bin/conda install -y numpy pandas SQLAlchemy requests lxml  virtualenv psycopg2
              - apt-get update && apt-get install -y libzbar0 libzbar-dev libgtk2.0-0
              - /opt/python/bin/pip install pyzbar
              - /opt/python/bin/conda install seaborn opencv=3.1.0 scipy libgcc boost=1.61.0 libpng=1.6.27 cython
              - /opt/python/bin/pip install libraries/imgforensics-0.1-cp36-cp36m-linux_x86_64.whl
              - /opt/python/bin/pip install -r requirements.txt
              - /opt/python/bin/pytest
    
    definitions:
      caches:
        condacache: /opt/python/bin
    
        2
  •  0
  •   jihong chen    8 年前

    你可能没有安装OpenCV3.1或者没有正确安装,这就是你不能导入它的原因。