import XMindDocument to create MINDMAP

619 Views Asked by At

I'm tring to import XMindDocument from mekk.xmind but I've gotten the error:

"ImportError: No module named mekk.xmind"

I've used pip to install mekk.xmind

pip install mekk.xmind

error: command '"C:\Users\frank\AppData\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

Can anyone help?

1

There are 1 best solutions below

0
max On

The module is broken.

I ended up manually copying the files cp -r <location>/mekk/xmind mekkxmind (where <location> can be found via pip show mekk.xmind) to my working directory and import it from there:

from mekkxmind import XMindDocument


xmind = XMindDocument.create(u"First sheet title", u"Root subject")
first_sheet = xmind.get_first_sheet()
root_topic = first_sheet.get_root_topic()

root_topic.add_subtopic(u"First item")
root_topic.add_subtopic(u"Second item")
t = root_topic.add_subtopic(u"Third item")
t.add_subtopic(u"Second level - 1")
t.add_subtopic(u"Second level - 2")
root_topic.add_subtopic(u"Detached topic", detached = True)
t.add_subtopic(u"Another detached", detached = True)
t.add_marker("flag-red")
root_topic.add_subtopic(u"Link example").set_link("https://stackoverflow.com/questions/42896645/import-xminddocument-to-create-mindmap")
root_topic.add_subtopic(u"With note").set_note(u"""This is just some dummy note.""")

xmind.pretty_print()
# xmind.save('test.xmind')