Treelib not working any longer on Google colab or https://jupyter.org/
mariomuellergermany opened this issue · 3 comments
Hi,
I was already using the library and really enjoyed.
But now it is not working any longer.
Im am using the code:
`%pip install treelib
from treelib import Node, Tree
tree = Tree()
tree.create_node("Harry", "harry") # root node
tree.create_node("Jane", "jane", parent="harry")
tree.create_node("Bill", "bill", parent="harry")
tree.create_node("Diane", "diane", parent="jane")
tree.create_node("Mary", "mary", parent="diane")
tree.create_node("Mark", "mark", parent="jane")
tree.show()
The result is:
b'Harry\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Bill\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Jane\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Diane\n \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Mary\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Mark\n'`
Was there an update? Why does it not work any longer?
thanks regards,
Mario
Same problem here, although not related Colab or Jupyter in any way. For me it doesn't work in VS Code, Python 3.9.13. I downgraded to 1.6.4 and all is good again.
The workaround from @realjanpaulus is not acceptable to me, because newlines are not displayed in output which means the whole tree is printed as one line, defeating the purpose of the function.
First save tree using tree.save2file("tree.txt")
then open it using text editor