This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Htseq throws error, No module named pysam,

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

rna-seq chip-seq next-gen sequencing

what is the output of following command ?

python -c 'import pysam'

Actually it doesn't give me anything as output

1 answer

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.

Hello, Thanks for your suggestions..my default python is anaconda python. which python /home/username/Tools/anaconda3/bin/python and I think Htseq-count doesn't consider it.

Log in to answer this question.