If you have multiple versions of Python on your system, make sure that the first line of your .py file specifies which to use -- for example, #!/usr/bin/env python2.7 (see here for some more information about the #! line)
Also, you probably want to be importing cv2 rather than opencv. I'm not sure of the exact history behind the name change, but all of the python code I've seen working with the latest version of opencv (and the example files which are provided when you install from source) uses cv2.