OpenCV 3 Python 3.5 Anaconda
<p>I  have tried installing opencv 3 in anaconda virtual env.I used the following binstar package..</p>

<pre><code>conda

source activate (envname)

conda install -c https://conda.binstar.org/menpo opencv

conda list 
</code></pre>

<p><strong>cv__version__ also  gives the correct output 3.1.0</strong></p>

<p>This is my first sample code</p>

<pre><code> import numpy as np
 import cv2

cap = cv2.VideoCapture(0)

  while(True):
# Capture frame-by-frame
ret, frame = cap.read()

# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) &amp; 0xFF == ord('q'):
    break

# When everything done, release the capture
 cap.release()
 cv2.destroyAllWindows()
</code></pre>

<p>I get the following errors on run ./fp.py: line 1: import: command not found
./fp.py: line 2: import: command not found
./fp.py: line 4: syntax error near unexpected token <code>('
./fp.py: line 4:</code>cap = cv2.VideoCapture(0)'</p>

<p>Whenever i used import video as video, i get errors saying error:video module not found.I think this has something todo with ffmpeg not being present in the binstar package i downloaded.</p>