nebari-dev / nebari-docs

📖 Documentation for Nebari
https://www.nebari.dev
BSD 3-Clause "New" or "Revised" License
14 stars 27 forks source link

[DOC] - Usage of opencv requires unique env build #443

Open kcpevey opened 2 months ago

kcpevey commented 2 months ago

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 run 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

Steps to Resolve this Issue

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.