Hello All,

I have ben trying to run Htseq-count for quite a while now. Its containing throwing error as follows,
Please Install PySam to use the BAM_Reader Class (http://code.google.com/p/pysam/) Error occurred when reading the beginning of SAM/BAM file.
  No module named pysam

And so as it is mentioned I have installed pysam and  when I run Htseq-count it still complains as   No module named pysam
I have installed pysam using pip install command line and as well as downloading the file. 
When I insatll pysam using pip its show as it is there
Requirement already satisfied (use --upgrade to upgrade): pysam in /home/user/Tools/anaconda3/lib/python3.4/site-packages/pysam-0.9.0-py3.4-linux-x86_64.egg

However, I think the htseq-count doesn't consider anaconda version of pysam. And so as I think its not taking into account the downloaded and installed  pysam package also. 

Any suggestions would be great on this issue

htseq-count will be using your default python installation and therefore not find the pysam module in your anaconda installation. He have had the same issue. 

Two options:

-Install pysam for your default python installation

-change the python interpreter in the htseq-count script. Find the script using 'which htseq-count', edit the interpreter at the top of the script to the path to your anaconda python.