RisingOrange / anki-mindmap

MIT License
4 stars 3 forks source link

Mindmap not working #9

Open huckleberrytwin opened 3 years ago

huckleberrytwin commented 3 years ago

I completed the setup sequence and at the end there was not a file named 'dot' rather it shows /usr/local/opt/graphviz

Here is the code on Anki with the error

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.16 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-08-17 16:55:47 Add-ons possibly involved: ⁨Mindmap from tag hierarchy⁩

Caught exception: Traceback (most recent call last): File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 46, in _on_show_button_click self._save_mindmap_to_file(f.name) File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 106, in _save_mindmap_to_file raise e File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 91, in _save_mindmap_to_file mindmap.save_as_img( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap.py", line 41, in save_as_img raise e File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap.py", line 30, in save_as_img create_mindmap_img( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/brain_dump/graphviz.py", line 112, in create_mindmap_img pygraph.write_svg(output_file_path, prog=pydot_program, encoding='utf-8') File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1609, in new_method self.write( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1691, in write s = self.create(prog, format, encoding=encoding) File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1785, in create stdout_data, stderr_data, process = call_graphviz( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 129, in call_graphviz process = subprocess.Popen( File "subprocess.py", line 854, in init File "subprocess.py", line 1702, in _execute_child PermissionError: [Errno 13] Permission denied: '/usr/local/opt/graphviz'

RisingOrange commented 3 years ago

Looks like it's an issue with the file permissions. It should work if you open a terminal and run this command: chmod +x /usr/local/opt/graphviz

If this gives you an error you cant try this instead: sudo chmod +x /usr/local/opt/graphviz

huckleberrytwin commented 3 years ago

I put both codes in the second one prompted me to put in my password and then nothing happened.

I tried mindmap again on Anki and still didn't work It came with this error

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.16 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-08-18 17:54:48 Add-ons possibly involved: ⁨Mindmap from tag hierarchy⁩

Caught exception: Traceback (most recent call last): File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 46, in _on_show_button_click self._save_mindmap_to_file(f.name) File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 106, in _save_mindmap_to_file raise e File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap_creator_dialog.py", line 91, in _save_mindmap_to_file mindmap.save_as_img( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap.py", line 41, in save_as_img raise e File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/mindmap.py", line 30, in save_as_img create_mindmap_img( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/brain_dump/graphviz.py", line 112, in create_mindmap_img pygraph.write_svg(output_file_path, prog=pydot_program, encoding='utf-8') File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1609, in new_method self.write( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1691, in write s = self.create(prog, format, encoding=encoding) File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 1785, in create stdout_data, stderr_data, process = call_graphviz( File "/Users/bobbyycao/Library/Application Support/Anki2/addons21/965278890/_vendor/pydot/pydot.py", line 129, in call_graphviz process = subprocess.Popen( File "subprocess.py", line 854, in init File "subprocess.py", line 1702, in _execute_child PermissionError: [Errno 13] Permission denied: '/usr/local/opt/graphviz'

RisingOrange commented 3 years ago

Is /usr/local/opt/graphviz a file or a directory? If it's a file you could try this: sudo chmod +w /usr/local/opt/graphviz

If it is a directory the command above won't fix it but then the dot file could be inside and have a path like this: /usr/local/opt/graphviz/2.40.1/bin/dot If you find this file, put it's path into the add-ons config as shown in the video: https://user-images.githubusercontent.com/31575114/117533363-aa587a80-afec-11eb-9b24-2ee58c837cde.mp4

JD-Huang commented 2 years ago

@RisingOrange

I encountered a similar problem. I just installed graphviz, added to path for all users, and tried to create a mind map, but I got the error message below.

It seems that I don't have a 'dot' file? Or my python crash somehow? Are there any ways for me to fix this? Thank you so much.

Anki 2.1.38 (355e4cd5) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=1 Add-ons, last update check: 2021-11-19 21:53:08

Caught exception: Traceback (most recent call last): File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890\mindmap_creator_dialog.py", line 46, in _on_show_button_click self._save_mindmap_to_file(f.name) File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890\mindmap_creator_dialog.py", line 91, in _save_mindmap_to_file mindmap.save_as_img( File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890\mindmap.py", line 41, in save_as_img raise e File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890\mindmap.py", line 30, in save_as_img create_mindmap_img( File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890_vendor\brain_dump\graphviz.py", line 112, in create_mindmap_img pygraph.write_svg(output_file_path, prog=pydot_program, encoding='utf-8') File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890_vendor\pydot\pydot.py", line 1609, in new_method self.write( File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890_vendor\pydot\pydot.py", line 1691, in write s = self.create(prog, format, encoding=encoding) File "C:\Users\jorda\AppData\Roaming\Anki2\addons21\965278890_vendor\pydot\pydot.py", line 1820, in create assert process.returncode == 0, ( AssertionError: "dot" with args ['-Tsvg', 'C:\Users\jorda\AppData\Local\Temp\tmpiyhpbkxc'] returned code: 1