Open kcpevey opened 2 months ago
In order to use opencv on Nebari, you need some additional libraries (OpenGL) that are not packaged with opencv on conda-forge.
opencv
If you only specify opencv in your environment, you'll get an error when you try to run import cv2:
import cv2
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[3], line 1 ----> 1 import cv2 ImportError: libOpenGL.so.0: cannot open shared object file: No such file or directory
Instead of installing opencv in your environment, you can install libopencv headless, like this:
channels: - conda-forge dependencies: - python=3.10 - libopencv *=headless*
We should document this process, probably as an FAQ, since we have a lot of users who are interested in opencv.
Preliminary Checks
Summary
In order to use opencv on Nebari, you need some additional libraries (OpenGL) that are not packaged with
opencv
on conda-forge.If you only specify
opencv
in your environment, you'll get an error when you try to runimport cv2
:Steps to Resolve this Issue
Instead of installing
opencv
in your environment, you can install libopencv headless, like this:We should document this process, probably as an FAQ, since we have a lot of users who are interested in opencv.