Obsidian_to_Anki
Obsidian_to_Anki copied to clipboard
Exception: cannot create note because it is a duplicate
Hi,
I get the following error while running the script in Python. I don't know which note creates the issue but I don't believe I have any duplicate.
~ % python /Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py -u /Users/raphaelhuleux/Documents/Notes/Recherche
Attempting to connect to Anki...
Connected!
Loading configuration file...
Loaded successfully!
Updating configuration file...
Config file exists, reading...
Configuration file updated!
Loading configuration file...
Loaded successfully!
Getting tag list
Adding media with these filenames...
['a_line_is_not_en_open_set.png', 'a_sequence_can_have_at_most_one_limit_fig_1.png', 'Screenshot 2021-02-16 at 15.58.11-3487501.png', 'cal_criterion_max.png', 'carbon_footprint.png', 'gamma_prob_2.png', 'CO2_emissions_country.png', 'co2_emissions_country_hab.png', 'composition_of_two_functions.png', 'concave_function_graph.png', 'conic_sections.png', 'convex_function_graph.png', 'cosinus.png', 'cosinus_2.png', 'Screenshot 2021-02-22 at 12.53.16-3994804.png', 'paste-cc6e14e06cdf0f41cb31185ae498af73d96cc672-4510155.jpg', 'discoverd_attack_Graph.png', 'eucliean_norm.png', 'F-test_fig_1.png', 'gamma_prob.png', 'geom_homo_function.png', 'image-20201126155816465.png', 'graph_quadratic_form_1.png', 'graph_quadratic_form_2.png', 'graph_quadratic_form_3.png', 'graph_quadratic_form_4.png', 'graph_quadratic_form_5.png', 'graph_implicit_theorem.png', 'isoquant_graph.png', 'level_sets_convex_function.png', 'limit_of_a_sequence_fig_1.png', 'max_function_constraint.png', 'max_function_equal_constraint.png', 'max_ineq_constrant.png', 'max_func_ineq_constrat_not_binding.png', 'Screenshot 2021-02-14 at 17.06.08-3318774.png', 'norms_of_two_vectors_angle_2.png', 'norms_of_two_vectors_and_their_angle.png', 'open_balls_are_open_sets.png', 'p_value_fig_1.png', 'param_rep_line.png', 'parametric_representation_line.png', 'parametric_representation_plane.png', 'param_rep_plane_points.png', 'parametric_representation_segment.png', 'partial_derivative.png', 'partial_derivative_2.png', 'pin_chess.png', 'properties_homo_utility_functions.png', 'ramanujan_summation.png', 'relation_gradient_ift.png', 'relation_between_total_derivative_plane.png', 'Screenshot 2021-01-22 at 12.45.50.png', 'slope_level_curve.png', 'Screenshot 2021-02-22 at 09.45.24.png', 'student_test_fig_1.png', 'student_test_fig_2.png', 'tangent_planes_level_sets_constant.png', 'gradient_level_curve.png', 'tobin_q.png', 'total_derivative.png', 'image-20201206160906248.png', 'world_energy_mix.png']
Adding directory requests...
Traceback (most recent call last):
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 1777, in <module>
main()
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 217, in main
App()
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 974, in __init__
directory.parse_requests_1(AnkiConnect.parse(response), tags)
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 1707, in parse_requests_1
file.note_ids = [
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 1708, in <listcomp>
AnkiConnect.parse(response)
File "/Users/raphaelhuleux/Documents/Projects/markdown_scripts/obisidan_to_anki/obsidian_to_anki.py", line 245, in parse
raise Exception(response['error'])
Exception: cannot create note because it is a duplicate
Some precisions:
- The code also stays stuck for a long time (10 minutes) at the
Adding directory requests..., before I get the error. - Some notes are added to Anki but have no IDs added to their file.
- I used an older version of the script (2. something) that stopped working, I think because of an update of Anki Connect. I updated to the last version and got this error (with both 3.4.1 and 3.4.0).
- The media files that the script tries to add are in notes that are already in Anki (including the images).
- I resetted the
.inifile, simply reconfiguring theGUI = False,Regex = Trueand adding my own Regex. See attached (as.txtbecause I can't add it otherwise).
Thanks in advance for your help!
EDIT: I moved back to the version 2.10 of the script and I don't have the issue anymore. But if I update to the last version, the issue comes up again. Something might have been broken with the last update?
Card duplicates are not generated with the obsidian-to-anki plugin as well.