That looks like a different module named pcop getting in the way. If there's another pcop.py in the directory where you're running it as a script, then that gets priority and you'll end up with an error like the one you got. However, if you run it interactively, then that directory is not checked, or is (normally) checked lower-down than, say, Python's standard library. Try checking if help(pcop) and dir(pcop) are what you expect in the script, and looking at where sys.path is looking for scripts.
-- http://mail.python.org/mailman/listinfo/python-list