import python opencv
When importing cv2, i'm getting that error :
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
15 Replies
Project ID:
13160e48-de83-4357-ae78-221b90810634
You might find these helpful:
- About cv2
- ImportError: libGL.so.1: cannot open shared object file: No such file or directory
⚠️ experimental feature
13160e48-de83-4357-ae78-221b90810634
do you have a nixpacks.toml?
i'm trying rn to add [phases.setup]
aptPkgs = ["ffmpeg", "libsm6", "libxext6"]
before you do that, try adding
opencv-python
to your requirements.txt filealready done
didn't work
then try this nixpacks.toml file
same error Traceback (most recent call last):
File "main.py", line 7, in <module>
import cv2
File "/opt/venv/lib/python3.8/site-packages/cv2/init.py", line 181, in <module>
bootstrap()
File "/opt/venv/lib/python3.8/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/nix/store/9493ngfjwisjm5f5s5ld5m34rdy431ic-python3-3.8.16/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
@Brody
please dont ping me like that
oh sorry
replace
opencv-python
with opencv-python-headless
thx
works?
Just changing from
opencv-python
to opencv-python-headless
in my pip worked for me. Thanks!