You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and now I get an error: "Download failed for English → Spanish."
I tried to debug it, and it seems that there is a strange behavior when attempting to install the language package:
When I looked at this line: argostranslate.package.install_from_path(package_to_install.download())
and then inside the 'download()' method, I saw that the method tries to find a path 'filepath' to the en->es package:
and it didn't find this 'filepath', and so it calls the 'get_from' method to download the data: data = networking.get_from(self.links)
yet it returned data = None, and that's what raised the error.
I then looked into the 'get_from' method, where it seems to attempt downloading the missing en->es package from the links supplied in the arguments, and it somehow fails to do that by its own. However, when I open the "https://..." link in my browser , the browser succeeds to install the package (in my user downloads folder...). So it is not clear why the package couldn't be installed automatically at the first place.
That is my main problem, as it prevents even the sample script from working, but further investigation reveals another problem:
When I looked at the name of the downloaded package, it was: 'translate-en_es-1_0.argosmodel', but looking back at the filename that the 'download()' method tried to find, it was directed to a package named 'translate-en_es.argosmodel' - so even after downloading the package to the right folder, the 'filepath' won't be found, as the downloaded package's name is different than the searched one. From what I understand this lead to installing the package every time the function is called, even if there is a relevant package already installed (but with an unexpected name to the script).
The text was updated successfully, but these errors were encountered:
tl;dr:
Elaborated:
I tried copying the example code for Python, supplied in the main GitHub page:
and now I get an error: "Download failed for English → Spanish."
I tried to debug it, and it seems that there is a strange behavior when attempting to install the language package:
When I looked at this line:
argostranslate.package.install_from_path(package_to_install.download())
and then inside the 'download()' method, I saw that the method tries to find a path 'filepath' to the en->es package:
and it didn't find this 'filepath', and so it calls the 'get_from' method to download the data:
data = networking.get_from(self.links)
yet it returned data = None, and that's what raised the error.
I then looked into the 'get_from' method, where it seems to attempt downloading the missing en->es package from the links supplied in the arguments, and it somehow fails to do that by its own. However, when I open the "https://..." link in my browser , the browser succeeds to install the package (in my user downloads folder...). So it is not clear why the package couldn't be installed automatically at the first place.
That is my main problem, as it prevents even the sample script from working, but further investigation reveals another problem:
When I looked at the name of the downloaded package, it was: 'translate-en_es-1_0.argosmodel', but looking back at the filename that the 'download()' method tried to find, it was directed to a package named 'translate-en_es.argosmodel' - so even after downloading the package to the right folder, the 'filepath' won't be found, as the downloaded package's name is different than the searched one. From what I understand this lead to installing the package every time the function is called, even if there is a relevant package already installed (but with an unexpected name to the script).
The text was updated successfully, but these errors were encountered: