ImportError libGL.so.1 cannot open shared object file No such file or directory

当你在Streamlit Community Cloud上部署的应用程序中使用OpenCV时,你会收到错误ImportError libGL.so.1 cannot open shared object file No such file or directory

如果您在应用中使用OpenCV,请在Streamlit Community Cloud的需求文件中包含opencv-python-headless,以替代opencv_contrib_pythonopencv-python

如果opencv-python是您的应用程序的必需(非可选)依赖项,或者是您应用程序中使用的库的依赖项,则上述解决方案不适用。相反,您可以使用以下解决方案:

在你的仓库中创建一个packages.txt文件,并添加以下行以安装apt-get依赖项 libgl

libgl1
forum

还有问题吗?

我们的 论坛 充满了有用的信息和Streamlit专家。