krmanik / Sentence-Adder-Anki-Addon

Add sentences to Anki editor window in one click
GNU Affero General Public License v3.0
14 stars 6 forks source link

Error with tsv file #6

Closed EmmanuelVRdz closed 3 years ago

EmmanuelVRdz commented 3 years ago

Hi, I was the one that rate bad a few hours ago because of an error. Here is my preview message and below I add the files you requested me:

deutsch_sentences TSV file.zip english_sentences TSV file.zip frances_sentences TSV file.zip japanesse_sentences TSV file.zip

Hi, I've tried many times to launch the addon but it keeps sending me an error when I try to load the language data with the tsv document. Could you please assist me with this one? I´m a little bit stuck right now. I will update de rating when everything runs ok! ok?

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.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-30 00:34:31

Caught exception: Traceback (most recent call last): File "C:\Users\Valde\AppData\Roaming\Anki2\addons21\1682655437__init__.py", line 95, in createDB for row in reader: File "C:\python\lib\codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 10: invalid start byte

### Update: Here I attach images of what appears today 30/03/2021

image image image image

If I try once again it sends me this: image

But actually, there's no language loaded: image

And, to be clear, it happens with all of the tsv files, with all the 4 languages that I tried to upload

Something to consider is that in the files directory of the addon it does appear the language: image image

krmanik commented 3 years ago

Did you downloaded from https://tatoeba.org/eng/downloads? When I open in notepad I view this. 1

But it should be like this. Three fields id lang sentences 2

There is problem with tsv files.

EmmanuelVRdz commented 3 years ago

Yes, but it is beacuase you didn't decompres the files, that´s why you can´t see it in order with the noteblock. I sent them still compresed, because gitHub don't let us to upload them decompresed, I think it doesn´t admit tsv files. But the error is still remaining.

image

image

image

Update: This is the error I was trying to share with you!!

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.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-30 00:34:31

Caught exception: Traceback (most recent call last): File "C:\Users\Valde\AppData\Roaming\Anki2\addons21\1682655437__init__.py", line 112, in selectFileFolderDlg if self.filepath.split("/")[-1].split(".")[1] == "tsv": IndexError: list index out of range

image

krmanik commented 3 years ago

The file again compressed with .tsv extension. I have extracted again to view the file.

The errors occur because this project only read .tsv file. So, if the file extension is not matching .tsv, it shows error. So, rename those file with .tsv extension and try again. It may works.

  1. Changing file name with .tsv demo_tsv

  2. Creating db with those files

demo_tsv1

EmmanuelVRdz commented 3 years ago

THANK YOU VERY MUCH

It was exactly what you said, the file extension was the issue. When changing the file extension to .tsv the files were able to be uploaded

image image