Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TypeError: VideoCapture() takes no arguments

Open
#518 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

The failure is reported in FaceDetectionMin.py at cv2.VideoCapture(0), with the same result for a video path. Start by reproducing that entry point and inspecting the installed cv2 package and VideoCapture binding; done means identifying the root cause and verifying a fix for both camera and file input.

Written by the indexing model from the issue text.

Description

incomplete

This is the code which iam tryng in PyCharm

import cv2
import time

cap = cv2.VideoCapture(0)


while True:
    success, img = cap.read()
    cv2.imshow("Image", img)
    cv2.waitKey(1)

Iam getting below error

"C:\Users\Support ACTA\AppData\Local\Programs\Python\Python37\python.exe" "E:/Project/Python/advanced computer vision/Face Detection/FaceDetectionMin.py"
Traceback (most recent call last):
  File "E:/Project/Python/advanced computer vision/Face Detection/FaceDetectionMin.py", line 4, in <module>
    cap = cv2.VideoCapture(0)
TypeError: VideoCapture() takes no arguments

If I use the the video path also, same error iam getting

Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opencv/opencv-python

All issues in opencv/opencv-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.