Pin opencv-python-headless in requirements
The GUI opencv-python build needs libGL.so.1 which headless Linux servers lack, causing "ImportError: libGL.so.1" at first cv2 use. Pin the headless build so a plain `pip install -r requirements.txt` works on servers out of the box (and survives a git reset). BgFilter only uses cv2 for computation, so headless is a drop-in on desktops too. Drop the now-unnecessary sed step from DEPLOY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -53,15 +53,9 @@ the default CUDA build and ~2–3 GB of `nvidia-*` packages you don't need on a
|
||||
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
||||
```
|
||||
|
||||
On a headless server use **`opencv-python-headless`** instead of `opencv-python`
|
||||
(the GUI build needs `libGL.so.1` etc. that servers usually lack):
|
||||
|
||||
```bash
|
||||
sed -i 's/^opencv-python$/opencv-python-headless/' requirements.txt
|
||||
```
|
||||
|
||||
Then install the rest. `torch`/`torchvision` are already satisfied, so this won't
|
||||
re-pull CUDA:
|
||||
`requirements.txt` already pins **`opencv-python-headless`** (the GUI build needs
|
||||
`libGL.so.1` etc. that headless servers lack), so no change is needed. Then install
|
||||
the rest — `torch`/`torchvision` are already satisfied, so this won't re-pull CUDA:
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
|
||||
Reference in New Issue
Block a user