Questions tagged [googletrans]

An unofficial Python library for interfacing with Google Translate

(unofficial) Googletrans: Free and Unlimited Google translate API for Python.

Translates totally free of charge.

https://github.com/ssut/py-googletrans

pip install googletrans

https://pypi.org/project/googletrans/

Googletrans is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make calls to such methods as detect and translate.

https://py-googletrans.readthedocs.io/en/latest/

59 questions
197
votes
18 answers

googletrans stopped working with error 'NoneType' object has no attribute 'group'

I was trying googletrans and it was working quite well. Since this morning I started getting below error. I went through multiple posts from stackoverflow and other sites and found probably my ip is banned to use the service for sometime. I tried…
steveJ
  • 2,171
  • 3
  • 11
  • 16
25
votes
11 answers

GoogleTrans API Error - Expecting value: line 1 column 1 (char 0)

I am having this error when translating thousands of text data in an iteration: Expecting value: line 1 column 1 (char 0) My code for translating big amounts of text: translatedList = [] for index, row in df.iterrows(): newrow =…
Kerem
  • 1,494
  • 2
  • 16
  • 27
4
votes
2 answers

Python (googletrans) - AttributeError: 'NoneType' object has no attribute 'group'

Trying to detect language code in Python using googletrans. But it generating ERROR (Refer error block for info). Require solution for the same Code : import googletrans from googletrans import Translator translator = Translator() result =…
K Ashish
  • 97
  • 1
  • 7
4
votes
3 answers

Googletrans API AttributeError

I keep getting "AttributeError: 'NoneType' object has no attribute 'group' " error even after changing gtoken on googletrans stopped working with error 'NoneType' object has no attribute 'group' but I got __init__() got an unexpected keyword…
Fahmi
  • 115
  • 2
  • 7
4
votes
2 answers

Python: Cannot install googletrans

I try to install googletrans https://pypi.org/project/googletrans/ by running this command as adviced: $ pip install googletrans but I always get same error both at python 3.5 and python 2.7: Collecting googletrans Using cached…
4
votes
1 answer

Python googletrans output differs from the web version of Google Translate

I am trying to use python googletrans package, but it produces lower-quality translations than the web interface of Google Translate. Here is my code: from googletrans import Translator translator = Translator() text = 'Проверим, насколько…
menelik3
  • 41
  • 3
4
votes
2 answers

How to tell Googletrans to ignore certain parts?

I would like to use googletrans to make use of the Google translate API. However, there are strings where are variable names in it: User "%(first_name)s %(last_name)s (%(email)s)" has been deleted. If I use this via googletrans I get from…
math
  • 1,868
  • 4
  • 26
  • 60
3
votes
2 answers

AttributeError: 'NoneType' object has no attribute 'group' googletrans python

Windows 7 Python 3.8.2 googletrans 3.0.0 from googletrans import Translator text = 'hello' translator = Translator() result = translator.translate(text).src Traceback (most recent call last): File "", line 1, in File…
Акмаль
  • 143
  • 1
  • 6
3
votes
0 answers

GoogleTrans for Input with Multiple Translations

From what I understand, GoogleTrans makes an Ajax call to the actual Google Translate. It's quite easy to set up and use. I am trying to translate English words into Spanish, but I see that the GoogleTrans module only returns a single translation…
3
votes
1 answer

Python googletrans encoding weird chars

I have an ui which takes german language among other things and translate these in english sentences. # -*- coding: utf-8 -*- from googletrans import Translator def tr(s) translator = Translator() return…
3
votes
3 answers

Why am I getting a ModuleNotFoundError when using googletrans

I have pip installed googletrans and more or less copied this code off a video but for some reason it cannot find the module. from googletrans import Translator text=("How to convert some text to multiple languages") destination_langauge={ …
Shoto
  • 33
  • 1
  • 1
  • 3
3
votes
2 answers

JSONDecodeError: using googletrans module

I'm trying to translate 100,000 English words to Korean by using 'googletrans' module. But after some iteration, it raises 'JSONDecodeError: Expecting value: line 1 column 1 (char 0)'. I tried to figure it out, but solutions on the web didn't…
zzaebok
  • 55
  • 1
  • 7
2
votes
0 answers

httpcore._exceptions.ReadTimeout: The read operation timed out | python googletrans library

I'm using Translator from the python library googletrans. I used it well for over 2 months now but somehow, today I received the "httpcore._exceptions.ReadTimeout: The read operation timed out for googletrans library": File…
SuzukuMiyota
  • 29
  • 1
  • 2
2
votes
1 answer

TypeError: the JSON object must be str, bytes or bytearray, not NoneType (while Using googletrans API)

I'm trying to translate a yml file using the googletrans API. This is my code: #Import from googletrans import Translator import re # API translator = Translator() # Counter counter_DoNotTranslate = 0 counter_Translate = 0 #Translater with…
Andre Bormans
  • 39
  • 1
  • 3
2
votes
1 answer

Exception in Tkinter callback and googletrans api

I'm trying to write a code for a translation app using python and googletrans API, the code looks fine but there seems to be errors in the tkinter and googletrans libraries. I'll show the code and errors, do help me out if you found the exact reason…
1
2 3 4