0

While using googletrans, I am unable to translate my text into any language. I am using python3 to do so.

I have googled many things related to my question and have found many answers on Stack Overflow about it suggesting that there could be a limit issue of characters or IP blocked. But this isn't the case with me. It was working fine some time ago and now it's giving error. And if I ran same code on Google Collab it works fine.

I have tried: clearing the cache; restarting my system twice; deleting the googletrans folder and re-installing. I have also tried the code on Spyder and on Jupyter notebook, but it gives me the same error.

Stack Overflow answers which I found but were of no help are:

  1. Googletrans API error - daily limit or blocked IP?
  2. why python googletrans suddenly not working?
  3. GoogleTrans API Error - Expecting value: line 1 column 1 (char 0)

This is my code:

from googletrans import Translator
translator = Translator()
trans = translator.translate("ajj bht garmi hai").text
trans

I am getting the error:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Maryam
  • 41
  • 1
  • 2
  • 9
  • Probably related: https://stackoverflow.com/questions/61042272/errow-using-googletranslate-package-in-python-expecting-value-line-1-column-1. Seems there could be a problem with the API right now. – dspencer Apr 05 '20 at 12:58
  • But i used the mentioned code on Google Colab and it worked fine. Its not working on Spyder or on Jupyter Notebook – Maryam Apr 05 '20 at 15:18

1 Answers1

0

Its working fine right now, it seems as a problem with the API yesterday.

Maryam
  • 41
  • 1
  • 2
  • 9