Note that there are some explanatory texts on larger screens.

plurals
  1. POBiopython Indentation Error
    primarykey
    data
    text
    <p>I've been dabbling in biopython for about a year and I recently upgraded to Biopython release 1.59. I've been refreshing my skills with some tutorials but I always get the error below when I run a for loop and any module from the biopython library:</p> <pre><code> IndentationError: expected an indented block </code></pre> <p>I only get this error when I call the .py file written in Komodo Edit version 7.0.2 from the command line terminal:</p> <pre><code> Priyas-iMac:~ Priya$ python /Users/priya/Documents/Python/Tutorials/BioParse.py Traceback (most recent call last): File "/Users/priya/Documents/Python/Tutorials/BioParse.py", line 4, in &lt;module&gt; SeqIO.write(rc, "/Users/priya/Documents/Python/Tutorials/ls_orchid_rc.fasta", "fasta") File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/SeqIO/__init__.py", line 400, in write from Bio import AlignIO File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/AlignIO/__init__.py", line 147, in &lt;module&gt; import NexusIO File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/AlignIO/NexusIO.py", line 19, in &lt;module&gt; from Bio.Nexus import Nexus File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Nexus/Nexus.py", line 15, in &lt;module&gt; import os,sys, math, random, copy File "/Users/Priya/Documents/Python/Tutorials/random.py", line 27 randLowHigh(5,10) ^ IndentationError: expected an indented block </code></pre> <p>When I use the command line to call old .py files that I wrote a year ago as above they run fine. And when I start up python directly and type in the tutorial example line by line it works fine:</p> <pre><code> Priyas-iMac:~ Priya$ python Python 2.7.3 (default, Apr 19 2012, 00:55:09) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; from Bio import SeqIO &gt;&gt;&gt; for seq_record in SeqIO.parse("/Users/priya/Documents/Python/Tutorials/ls_orchid.txt","fasta"): ... print seq_record.id ... gi|2765658|emb|Z78533.1|CIZ78533 gi|2765657|emb|Z78532.1|CCZ78532 </code></pre> <p>How can I fix my .py file so I can just run it from the terminal?</p> <p>Any insight into this problem would be greatly appreciated!</p> <p>Priya</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload