解决容器cv2报错问题
2021-10-19 本文已影响0人
一个摸鱼AI喵
报错信息
File "./comparison_insightface/urls.py", line 3, in <module>
from . import views
File "./comparison_insightface/views.py", line 3, in <module>
import cv2
File "/usr/local/lib/python3.6/dist-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
RUN apt-get update && apt-get install \
libglib2.0-dev \
libgl1-mesa-dev
libxrender1 \
libgl1-mesa-glx \
libxext-dev \
但有可能没有权限,需要在创建镜像的时候
RUN apt-get update && apt-get install sudo
否则进入以管理员进入容器 docker exec -it -u root id /bin/bash
然后apt-get update跟install