SystemError: <class 'cv2.VideoCapture'> returned a result with an exception set

Yh i have the Opencv installed , Here is what pip list prints ,

Package Version


absl-py 1.4.0
aiofiles 22.1.0
asgiref 3.7.2
attrs 22.1.0
backcall 0.2.0
blinker 1.6.2
cachetools 4.2.4
certifi 2022.12.7
cffi 1.17.1
charset-normalizer 3.0.1
click 8.1.7
colorama 0.4.6
colormath 3.0.0
cupy-cuda12x 13.3.0
debugpy 1.6.4
decorator 4.4.2
defusedxml 0.7.1
dill 0.2.5
distlib 0.3.6
dnspython 2.3.0
entrypoints 0.4
executing 1.2.0
fastjsonschema 2.16.2
fastrlock 0.8.2
filelock 3.12.2
Flask 2.3.0
Flask-Login 0.6.3
Flask-Script 2.0.6
Flask-SQLAlchemy 3.1.1
fqdn 1.5.1
future 0.16.0
gevent 23.9.1
google-api-core 2.14.0
google-api-python-client 2.147.0
google-auth 2.23.4
google-auth-httplib2 0.2.0
google-auth-oauthlib 1.2.1
google-cloud-core 2.3.3
google-cloud-storage 2.13.0
google-crc32c 1.5.0
google-resumable-media 2.6.0
googleapis-common-protos 1.61.0
greenlet 3.0.1
gunicorn 20.1.0
h11 0.14.0
httplib2 0.22.0
idna 3.4
imageio 2.35.1
imageio-ffmpeg 0.5.1
imutils 0.5.4
ipython-genutils 0.2.0
itsdangerous 2.1.2
jeepney 0.8.0
Jinja2 3.1.2
jsonpointer 2.3
jupyterlab-pygments 0.2.2
jupyterlab-widgets 3.0.4
lazy-object-proxy 1.9.0
login 0.0.6
MarkupSafe 2.1.3
mccabe 0.6.1
mistune 2.0.4
moviepy 1.0.3
mypy-extensions 1.0.0
nest-asyncio 1.5.6
networkx 3.2.1
numpy 1.26.2
oauthlib 3.2.2
opencv 4.10.0
packaging 22.0
pandocfilters 1.5.0
parso 0.8.3
pickleshare 0.7.5
pillow 10.4.0
pip 25.0.1
platformdirs 4.0.0
pluggy 1.2.0
ply 3.8
proglog 0.1.10
prometheus-client 0.15.0
prompt-toolkit 3.0.36
protobuf 3.19.6
psutil 5.9.4
psycopg2 2.9.9
ptyprocess 0.7.0
pure-eval 0.2.2
pyasn1 0.5.0
pyasn1-modules 0.3.0
pycodestyle 2.6.0
pycparser 2.21
pydantic 1.10.4
pydocstyle 6.3.0
pyflakes 2.2.0
Pygments 2.13.0
pymongo 4.4.0
pyparsing 3.1.0
pyreadline 2.1
pyrsistent 0.19.2
python-dateutil 2.8.2
python-json-logger 2.0.4
python-jsonrpc-server 0.4.0
pytoolconfig 1.2.5
pytz 2023.3
pywinpty 2.0.13
QtPy 2.3.0
requests 2.28.2
requests-oauthlib 2.0.0
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rsa 4.9
scipy 1.11.4
Send2Trash 1.8.0
setuptools 75.1.0
six 1.16.0
sniffio 1.3.0
snowballstemmer 2.2.0
soupsieve 2.3.2.post1
SQLAlchemy 2.0.35
sqlparse 0.4.4
supervisor 4.2.2
tensorboard-data-server 0.7.1
tensorflow-estimator 2.12.0
termcolor 2.3.0
terminado 0.17.1
tinycss2 1.2.1
toml 0.10.2
tomli 2.0.1
tomlkit 0.11.8
tornado 6.2
tqdm 4.66.5
traitlets 5.7.1
typing_extensions 4.12.2
tzdata 2023.3
ujson 5.8.0
uri-template 1.2.0
uritemplate 4.1.1
urllib3 1.26.14
wcwidth 0.2.5
webcolors 1.12
webencodings 0.5.1
websocket-client 1.4.2
Werkzeug 2.3.0
widgetsnbextension 4.0.4
wrapt 1.14.1
zipp 3.15.0
zope.event 5.0
zope.interface 6.1

I also need to add that when i perform another process like cve.imread, it works fine so i think this problem is strictly happening for cv2.videocapture. I think this might help narrowdown the problem.