1
저는 이미 파이썬 버전 3.6을 윈도우와 아나콘다에 설치했습니다. Jupyter Notebook의 코드에 Biopython 패키지를 사용하고 싶습니다.Jupyter Notebook의 Biopython? Windows 7
conda install -c anaconda biopython=1.68
아래 코드를 실행하려면 제대로 작동하지 않습니다. fasta는 시퀀스가 포함 된 파일 일뿐입니다.
from Bio import SeqIO
handle = open("Q1.fasta")
record_iterator = SeqIO.parse(handle, "fasta")
seq1_20 = record_iterator.next()
seq2_20 = record_iterator.next()
seq3_20 = record_iterator.next()
seq1_100 = record_iterator.next()
seq2_100 = record_iterator.next()
handle.close()
print seq1_20
print seq2_20
print seq3_20
print seq1_100
print seq2_100
이 출력하는 시퀀스를해야하지만, 그것은 말한다 :
AttributeError
Traceback (most recent call last)
<ipython-input-4-d5af48173555> in <module>()
2 handle = open("Q1.fasta")
3 record_iterator = SeqIO.parse(handle, "fasta")
----> 4 seq1_20 = record_iterator.next()
5 seq2_20 = record_iterator.next()
6 seq3_20 = record_iterator.next()
AttributeError: 'generator' object has no attribute 'next'
가, 누군가가 나이 나갈 도와주세요!
'AttributeError'를 (를) 검색 했습니까? 파이썬이 던지고 있습니까? – gobrewers14