External Methods & Symbol Table & BioPython
Hello, I'm trying to use BioPython in an External Method but it return "ImportError: cannot import name FastaReader" (and others functions). I check some "tricks" but nothing change. Then I modify my external method to know what happening with the symbol table: The program: """ def SequenceRead(SequenceString): import StringIO import Bio.SeqIO.FASTA return vars(Bio.SeqIO.FASTA).keys() """ When I run it at command line the function return: """ ['Bio', 'string', 'Seq', 'FastaReader', '__builtins__', '__file__', 'SeqRecord', 'FastaWriter', '__name__', 'os', '__doc__'] """ That's ok. But When I run it in Zope the function return: """ ['Bio', 'string', 'Seq', '__builtins__', '__name__', '__file__', 'os', '__doc__'] """ The function lost the "FastaReader", "SeqRecord" and "FastaWriter" in the symbol table!!! What's wrong? Must I change something to change them to public functions? Thxs, Cristian. -- Lic. Cristian S. Rocha. <crocha@dc.uba.ar> Departamento de Computacin. FCEyN. UBA. Pabellon I. Cuarto 9. Ciudad Universitaria. (1428) Buenos Aires. Argentina. Tel: +54-11-4576-3390/96 int 714 Tel/Fax: +54-11-4576-3359 Cel: 15-5-607-9192
Cristian S. Rocha wrote at 2004-4-22 17:33 -0300:
I'm trying to use BioPython in an External Method but it return "ImportError: cannot import name FastaReader" (and others functions). I check some "tricks" but nothing change.
Then I modify my external method to know what happening with the symbol table:
The program:
""" def SequenceRead(SequenceString): import StringIO import Bio.SeqIO.FASTA
return vars(Bio.SeqIO.FASTA).keys()
"""
When I run it at command line the function return:
""" ['Bio', 'string', 'Seq', 'FastaReader', '__builtins__', '__file__', 'SeqRecord', 'FastaWriter', '__name__', 'os', '__doc__'] """
That's ok. But When I run it in Zope the function return:
""" ['Bio', 'string', 'Seq', '__builtins__', '__name__', '__file__', 'os', '__doc__'] """
The function lost the "FastaReader", "SeqRecord" and "FastaWriter" in the symbol table!!!
Check your log file whether you see any exceptions there. If not, check your code whether it contains "except ImportError:" clauses. -- Dieter
participants (2)
-
Cristian S. Rocha -
Dieter Maurer