[Biopython] Query

Peter Cock p.j.a.cock at googlemail.com
Fri Jul 15 09:37:03 UTC 2011


On Fri, Jul 15, 2011 at 8:29 AM, isha srivastava
<srivastavaisha.06 at gmail.com> wrote:
>    Hello,
>
>    I am new user of BioPython.
>    I have Downloaded the latest version of BioPython  i.e. BioPython 1.57.
>    fallowed all the instructions according to tutorial.
>    but wen i am running the program :
>
>     >>> from Bio import SeqIO
>     >>> for seq_record in SeqIO.parse("ls_orchid.fasta", "fasta"):
>     ...         print seq_record.id
>     ...         print repr(seq_record.seq)
>     ...         print len(seq_record)
>     ...
>
>
>    it is showing error as fallows :-
>
>    Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     File "/usr/lib/pymodules/python2.6/Bio/SeqIO/__init__.py", line 424, in
> parse
>     raise TypeError("Need a file handle, not a string (i.e. not a
> filename)")
>    TypeError: Need a file handle, not a string (i.e. not a filename)
>
> Sir, how to solve this error?

That happens on older versions of Biopython - you can check
what is being used within python with:

import Bio
print Bio.__version__

My guess is your install of Biopython 1.57 hasn't worked properly,
and an older version is still being used.

Peter




More information about the Biopython mailing list