Ran into this error in coverage.py:
coverage.py", line 131, in _processBam bamfile = pysam.Samfile(bamFile, 'rb') NameError: name 'pysam' is not defined
Adding import pysam right in front of this line solves the problem. Suggest adding pysam as a global import or add import pysam in the _processBam function.