title: Cannot access built-in webcam Python
body: <p>I'm trying to access my laptop webcam and from what I have seen, I need to use the cv2 package. I downloaded it from <a href="https://pypi.python.org/pypi/opencv-python/3.2.0.7" rel="nofollow noreferrer">PyPi</a> but the contents of the file seem to be missing a lot of content as it only has <code>__init__.py</code>, <code>cv2.cp36-win32.pyd</code>, and <code>opencv_ffmpeg320.dll</code>. So whenever I try use things such as <code>VideoCapture</code> and <code>imwrite</code>, it says it cannot find a reference to them. </p>
  
  <p>When I run the application, I get the following error message:</p>
  
  <pre><code>ImportError: numpy.core.multiarray failed to import
  Traceback (most recent call last):
    File "C:/Users/RedCode/PycharmProjects/FunApps/ImageFile.py", line 1, in &lt;module&gt;
      import cv2
    File "C:\Users\RedCode\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cv2\__init__.py", line 7, in &lt;module&gt;
      from . import cv2
  ImportError: numpy.core.multiarray failed to import
  </code></pre>
  
  <p>I have got the numpy package installed and imported but it didn't fix the issue so I'm guessing that's not the actual cause of the problem, so I'm certain it must have something to do with the cv2 package. </p>
  
  <p>The code I'm using right now is as follows:</p>
  
  <pre><code>import cv2
  import numpy
  
  cv2.namedWindow("preview")
  vc = cv2.VideoCapture(0)
  
  if vc.isOpened(): # try to get the first frame
      rval, frame = vc.read()
  else:
      rval = False
  
  while rval:
      cv2.imshow("preview", frame)
      rval, frame = vc.read()
      key = cv2.waitKey(20)
      if key == 27: # exit on ESC
          break
  cv2.destroyWindow("preview") 
  </code></pre>
  
  <p>I'm also using Python 3.6 and Windows 10 if that helps with anything. </p>
  
  <p>How can I get my application to work?</p>