I am using Pysam to process a bam file containing paired reads. However, I get the error 

    AttributeError: 'csamtools.AlignedRead' object has no attribute 'rnext'

when I try to extract the chromosome that the mate of a read is aligned to. What am I doing wrong?

    for row in samfile:
        print(samfile.getrname(row.rname)+' '+samfile.getrname(row.rnext))

It gives the read's reference properly, however it gives an error for the mate's reference.
Hi,

Looks like your pysam installation is too old and doesn't support rnext (see also QA3.2 [here](https://github.com/BSSeeker/BSseeker2)). Which version are you using? According to the logs rnext was introduced end of 2011, i.e. any version >= 0.6 should work.

Andreas