[Biopython] biopython cookbook error

Brad Chapman chapmanb at 50mail.com
Mon Jun 27 10:38:34 UTC 2011


Hugo;
Thanks for the e-mail and reporting the problem you were running
into.

> Hi, I am new to this list excuse me if this is not the appropriate place to
> report this:
> 
> I am just trying to teach myself some biopython and at section "2.4.1  Simple
> FASTA parsing example" of the biopython tutorial it suggests us to run this
> code:
[...]
> Which outputs the error:
[...]
> > TypeError: Need a file handle, not a string (i.e. not a filename)

It sounds like you have an old version of Biopython. SeqIO was
changed a few releases ago to support string filenames instead of
handles for the reason you mention: to make it easier for new Python
developers. See FAQ #14 for more information, and #3 for information
about checking your version of Biopython:

http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc5

If you have easy_install available, you can update with:

sudo easy_install -U biopython

Hope this helps,
Brad



More information about the Biopython mailing list