ryhaberecht / FEV-KEGG

FEV@KEGG: Finding Evolutionary Vigour @ KEGG
MIT License
2 stars 0 forks source link

'xml.etree.ElementTree.Element' object has no attribute 'getchildren' #2

Closed mathilde56 closed 3 years ago

mathilde56 commented 3 years ago

Hi,

I wanted to run the code in FEV-KEGG/FEV_KEGG/Experiments/03.py (I need to do something similar) but I got this message :

eco01100 = eco.getPathway('01100')
  File "C:\Users\pixou\AppData\Local\Programs\Python\Python39\lib\site-packages\FEV_KEGG\KEGG\Organism.py", line 164, in getPathway     
    return Database.getPathway(self.nameAbbreviation, pathwayName)
  File "C:\Users\pixou\AppData\Local\Programs\Python\Python39\lib\site-packages\FEV_KEGG\KEGG\Database.py", line 122, in getPathway     
    pathway = KGML_parser.read(fileHandle)
  File "C:\Users\pixou\AppData\Local\Programs\Python\Python39\lib\site-packages\FEV_KEGG\lib\Biopython\KEGG\KGML\KGML_parser.py", line 45, in read
    first = next(iterator)
  File "C:\Users\pixou\AppData\Local\Programs\Python\Python39\lib\site-packages\FEV_KEGG\lib\Biopython\KEGG\KGML\KGML_parser.py", line 80, in parse
    yield KGMLParser(elem).parse()
  File "C:\Users\pixou\AppData\Local\Programs\Python\Python39\lib\site-packages\FEV_KEGG\lib\Biopython\KEGG\KGML\KGML_parser.py", line 173, in parse
    for element in self.entry.getchildren():

i would be grateful if you could help me :)

ryhaberecht commented 3 years ago

Hi,

there was an incompatibility with Python 3.9 in Biopython: https://github.com/biopython/biopython/commit/62055a702c2c556b07d18c0e18bb63bbdfb9b24a I backported the fix into KGML_parser.py.

Can you try the current master (or just replace KGML_parser.py) if it works now, since I am still on Python 3.6?

mathilde56 commented 3 years ago

Ah yes it works now! Thank you very much for your help and your speed, I can move forward in my internship now: D

ryhaberecht commented 3 years ago

Glad I could help. Have fun learning!