[miso-users] cannot import name defaultdict error about MISO

Yarden Katz yarden at MIT.EDU
Mon Jul 16 14:22:38 EDT 2012


Hi all,

I just checked with the latest GitHub version and cannot reproduce the error.  I did:

$ git clone https://github.com/yarden/MISO.git
$ cd MISO/
$ make Pythonpackage
$ python setup.py install
$ cd misopy/
$ python test_miso.py

And it ran successfully.

Are you sure you're not using an old Python version that is pre-collections?  The line:

from collections import defaultdict

Should work on any Python 2.6 or later, I believe.  You should be able to type:

$ python
>> from collections import defaultdict

with no error.

Best, --Yarden




On Jul 16, 2012, at 1:59 PM, Gabriel Otte wrote:

> Hi.  I have the same error when running my test.  Please advise.
> 
> Best,
> 
> Gabe
> On Jul 13, 2012, at 7:48 AM, Huajing Teng wrote:
> 
>> Dear Dr,
>> I have installed MISO. When module_availability.py was used, all modules are available. However when i run test_miso.py, i got error:cannot import name defaultdict
>> [tenghuajing at master misopy]$ python2.6 test_miso.py
>> Testing conversion of SAM to BAM...
>> Executing: python /home/share1/huajingteng/soft/misopy-0.4.3/misopy/sam_to_bam.py --convert /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-data/sam-data/c2c12.Atp2b1.sam /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output
>> Converting SAM to BAM...
>> - Executing: samtools view -Sbh /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-data/sam-data/c2c12.Atp2b1.sam  > /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output/c2c12.Atp2b1.bam
>> [samopen] SAM header is present: 35 sequences.
>> Sorting BAM file...
>> - Executing: samtools sort /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output/c2c12.Atp2b1.bam /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output/c2c12.Atp2b1.sorted
>> Indexing BAM...
>> - Executing: samtools index /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam
>> Conversion took 0.02 minutes.
>> .Testing gene-level Psi...
>> Testing GFF indexing of: /home/share1/huajingteng/soft/misopy-0.4.3/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff
>> Executing: python /home/share1/huajingteng/soft/misopy-0.4.3/misopy/index_gff.py --index /home/share1/huajingteng/soft/misopy-0.4.3/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff /home/share1/huajingteng/soft/misopy-0.4.3/misopy/gff-events/mm9/genes/Atp2b1/indexed
>> Traceback (most recent call last):
>> File "/home/share1/huajingteng/soft/misopy-0.4.3/misopy/index_gff.py", line 11, in ?
>>   from collections import defaultdict
>> ImportError: cannot import name defaultdict
>> Executing: python /home/share1/huajingteng/soft/misopy-0.4.3/misopy/run_events_analysis.py  --compute-genes-psi /home/share1/huajingteng/soft/misopy-0.4.3/misopy/gff-events/mm9/genes/Atp2b1/indexed /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam --output-dir /home/share1/huajingteng/soft/misopy-0.4.3/misopy/test-output/gene-psi-output --read-len 35 
>> Traceback (most recent call last):
>> File "/home/share1/huajingteng/soft/misopy-0.4.3/misopy/run_events_analysis.py", line 9, in ?
>>   from collections import defaultdict
>> ImportError: cannot import name defaultdict
>> .
>> ----------------------------------------------------------------------
>> Ran 2 tests in 3.596s
>> 
>> OK
>> 
>> I wonder whether you can give me some suggestion. Thank you very much.
>> 
>> 				
>> --------------
>> Huajing Teng
>> 
>> 
>> _______________________________________________
>> miso-users mailing list
>> miso-users at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/miso-users
> 
> 
> _______________________________________________
> miso-users mailing list
> miso-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/miso-users




More information about the miso-users mailing list