You would need to install a specific version of GoogleTrans package. pip3 uninstall googletrans pip3 install googletrans==3.1.0a0 This is one of the solutions mentioned in Github issues.
@@492_alokjha9 I got the same problem. Google Translate API has been updated. In your terminal, run this command: pip install googletrans==3.1.0a0 This command will install the new googletranslate API. It will remove this error. Also, when you translate, make sure you say: translator.translate(text, dest="en"). The dest="en" makes sure that you are translating to english. If you wanted to translate to french, you would use dest="fr". I hope this helped!
Hi, when I try to do exactly that kind of translate, I get this kind of error: httpcore._exceptions.ConnectTimeout: _ssl.c:1106: The handshake operation timed out
i got this too because of some issues of this module,but i fixed it with another version of googletrans.You can use "pip install googletrans==3.1.0a0" instead,everything work fine now.But as i found,this module is no longer supported and you should use google cloud translate for better result.
Hi, when I try to do exactly that kind of translate, I get this kind of error; Traceback (most recent call last): File "c:\Users\Momentum\Desktop\yandexTranslateTxt.py", line 15, in translated_text = Translator().translate(text, src='en', dest='tr') File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\client.py", line 182, in translate data = self._translate(text, dest, src, kwargs) File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\client.py", line 78, in _translate token = self.token_acquirer.do(text) File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\gtoken.py", line 194, in do self._update() File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\gtoken.py", line 62, in _update code = self.RE_TKK.search(r.text).group(1).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group'
You would need to install a specific version of GoogleTrans package. pip3 uninstall googletrans pip3 install googletrans==3.1.0a0 yukardaki eleman yazmis gördün mü bilmem ama
@@mfatihy70 Bu uygulamayla birlikte artık çeviriyi istediğimiz zaman kullanabiliriz demi? Yani mesela diyelim ki google ücret getirdi ve artık translate belli bir ücret karşılığında internetten kullanılmaya başlanacak peki bu uygulama üzerinden yine kullanabilecek miyiz? Sağolasın. Sorumun özeti şu bu yapılan şey yine internette ki çeviriye muhtaç mı?
Is there is any limitations of using google trans library as I can see after certain searches it won't work and provide the same results as what we are giving as input
@@priyankasaxena802 if you are making a loop, try time.sleep(10) in between each interation, otherwise google will just end up temporarily banning your ip
I'm getting this error please help me sir. Listening... Recognizing... User said: translate hello 'NoneType' object has no attribute 'group' Code:elif 'translate' in query: try: speak('translating your sentences or words.....') query=query.replace("translate", " ") translator =Translator() result=translator.translate(query,dest='hi') speak('according the google translate') print(result.pronunciation) speak(result.pronunciation) except Exception as e: print(e) speak("try with the another sentences or try after sometime")
@@kyozuperso5613 there is a new googletranslate update. you need to run this in your terminal: pip install googletrans==3.1.0a0 im not really sure what your error is but it looks like thats what the majority of the comments here are asking for so im going to guess that you have the same problem hope this helped!
Is it possible to get the examples and definition of the word in the native language if you use this package? For example, if I translate the word "luego" from spanish I get "soon" as a translation, but I also get an example: "primero comieron y luego tomaron café." and the word definition in spanish: "Más tarde en el tiempo, inmediatamente después o en un momento no muy lejano; puede referirse tanto al tiempo del cual se habla como al momento en el que se habla o se escribe". My point is: I want to construct a database with the original word, the translation, the example and the definition too. Is it possible? I did it using selenium, but it takes too much time.
Hey I don’t know if you still need this but Google now how’s an advance glossary feature with let’s you set a predefined custom definition like you described.
you can select the entire column by using df['column_name'] = df['Orginalcolumn'].apply(translator.translate, src='en', dest='hi').apply(getattr, args=('text',))
Ah yes. You need to put in the text you want to translate. For example: import googletrans from googletrans import Translator translator = Translator() result = translator.translate("Hola", dest="en") print(result) The translator.translate requires you to put in the text you want to translate, and what language you want to translate it to. This program should print out an array, and in the array, one of the elements should be: text=hello I hope this helped!
you can use files for example, you could say filevar = open("filename.txt", r) #iterate through file #create list to append characters to lst = [] for characters in filevar: #adds characters to list lst.append(characters) #join list words = lst.join("") words is a string, so now you can use the googletranslate api. translator = Translator() translation = translator.translate(words, dest="en") #converts whatever language the file is, to english print(translation) The entire code would be: import googletrans from googletrans import Translator translator = Translator() filevar = open("filename.txt", r) #iterate through file #create list to append characters to lst = [] for characters in filevar: #adds characters to list lst.append(characters) #join list words = lst.join("") translator = Translator() translation = translator.translate(words, dest="en") #converts whatever language the file is, to english print(translation) #---------------------------------------------------------------------------- Now say you wanted to replace the file with the translated text. You could do this by overwriting the file. This would be done by running the following code: import googletrans from googletrans import Translator translator = Translator() filevar = open("filename.txt", "r") #reads file #iterate through file #create list to append characters to lst = [] for characters in filevar: #adds characters to list lst.append(characters) filevar.close() #closes the file because you are done using it #join list words = lst.join("") translator = Translator() translation = translator.translate(words, dest="en") #converts whatever language the file is, to english filevar1 = open("filename.txt", "w") #instead of reading file, its going to write in the file. If you wanted to add content to the current file, you could use "a" instead of "w". "a" stands for append. filevar1.write(words) #overwrites the file and replaces the old text with the new translated text filevar1.close() #------------------------------------------------------------------------- you can now view the file and hopefully there should be new text note: i haven't run any of this code yet. There might be a few errors but I hope this gave you an idea of what you can do. Hope this helped!
You can support me on Patreon
www.patreon.com/parwizforogh
Showing error :AttributeError: 'NoneType' object has no attribute 'group'
You would need to install a specific version of GoogleTrans package.
pip3 uninstall googletrans
pip3 install googletrans==3.1.0a0
This is one of the solutions mentioned in Github issues.
I m still getting the same error
any solution?
@@karankalani4002 any solution?
Hi!!! I'm following your tutorial, but the following error appears: AttributeError: 'NoneType' object has no att. How to solve?
were you able to fingure it out?If yes do share
@@492_alokjha9 I got the same problem. Google Translate API has been updated. In your terminal, run this command: pip install googletrans==3.1.0a0
This command will install the new googletranslate API. It will remove this error.
Also, when you translate, make sure you say: translator.translate(text, dest="en"). The dest="en" makes sure that you are translating to english. If you wanted to translate to french, you would use dest="fr".
I hope this helped!
@@mathperson6927 Yes bro I was able to figure it out later. Thanks though
@@mathperson6927 You now need to do:
pip install googletrans==4.0.0-rc1
Oh, there’s a new version now? Good to know!
Thanks
Hi, when I try to do exactly that kind of translate, I get this kind of error:
httpcore._exceptions.ConnectTimeout: _ssl.c:1106: The handshake operation timed out
i got this error AttributeError: 'NoneType' object has no attribute 'group'
me too
i got this too because of some issues of this module,but i fixed it with another version of googletrans.You can use "pip install googletrans==3.1.0a0" instead,everything work fine now.But as i found,this module is no longer supported and you should use google cloud translate for better result.
@@TheGeniusfire +1 respect for "Đồng Bào"
@@TheGeniusfire Thank you so much
@@TheGeniusfire I was looking for this solution for 2 hours thank your soo much....u are my saver
Getting an error of SSL: Certificate_verify_failed, what to do for this can you suggest
Is it possible to pass an entire document for translation to this api? Like docx or pdf
Hi, when I try to do exactly that kind of translate, I get this kind of error;
Traceback (most recent call last):
File "c:\Users\Momentum\Desktop\yandexTranslateTxt.py", line 15, in
translated_text = Translator().translate(text, src='en', dest='tr')
File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\client.py", line 182, in translate
data = self._translate(text, dest, src, kwargs)
File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\client.py", line 78, in _translate
token = self.token_acquirer.do(text)
File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\gtoken.py", line 194, in do
self._update()
File "C:\Users\Momentum\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\gtoken.py", line 62, in _update
code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'
You would need to install a specific version of GoogleTrans package.
pip3 uninstall googletrans
pip3 install googletrans==3.1.0a0
yukardaki eleman yazmis gördün mü bilmem ama
@@mfatihy70 Reis birşey sorabilir miyim?
@@alifurkan3106 hayir mi diyecrm knk sor
@@mfatihy70 Bu uygulamayla birlikte artık çeviriyi istediğimiz zaman kullanabiliriz demi? Yani mesela diyelim ki google ücret getirdi ve artık translate belli bir ücret karşılığında internetten kullanılmaya başlanacak peki bu uygulama üzerinden yine kullanabilecek miyiz? Sağolasın. Sorumun özeti şu bu yapılan şey yine internette ki çeviriye muhtaç mı?
@@alifurkan3106 evet translate sunucularına bağlanıyor direkt çeviri dosyalarını indirmiyor
Is there is any limitations of using google trans library as I can see after certain searches it won't work and provide the same results as what we are giving as input
did u get any solution?
@@priyankasaxena802 if you are making a loop, try time.sleep(10) in between each interation, otherwise google will just end up temporarily banning your ip
I'm getting this error please help me sir.
Listening...
Recognizing...
User said: translate hello
'NoneType' object has no attribute 'group'
Code:elif 'translate' in query:
try:
speak('translating your sentences or words.....')
query=query.replace("translate", " ")
translator =Translator()
result=translator.translate(query,dest='hi')
speak('according the google translate')
print(result.pronunciation)
speak(result.pronunciation)
except Exception as e:
print(e)
speak("try with the another sentences or try after sometime")
You need to get the updated version, pip install googletrans==4.0.0-rc1
Pls How can i print my translated words only ??
print(translator.translate(text, dest='en').text)
Too late, but for anyone who need it
Hi.. it is showing ModuleNotFoundError: No module named 'googletrans' after 'pip install googletrans'.
it doesn't work anymore
Why ?
it dosnn"t work for me to. but why.
@@kyozuperso5613 there is a new googletranslate update. you need to run this in your terminal: pip install googletrans==3.1.0a0
im not really sure what your error is but it looks like thats what the majority of the comments here are asking for so im going to guess that you have the same problem
hope this helped!
@@mathperson6927 i already solved the problem but yea it was. Thanks you :)
@mathperson6927 confirmed, works, thank you
It's not really translating, thought, is it? It's just substituting variables
Hi,
Do we get my memory warning error.
i mean , is there any limit to translate words?
Is it possible to get the examples and definition of the word in the native language if you use this package? For example, if I translate the word "luego" from spanish I get "soon" as a translation, but I also get an example: "primero comieron y luego tomaron café." and the word definition in spanish: "Más tarde en el tiempo, inmediatamente después o en un momento no muy lejano; puede referirse tanto al tiempo del cual se habla como al momento en el que se habla o se escribe".
My point is: I want to construct a database with the original word, the translation, the example and the definition too. Is it possible? I did it using selenium, but it takes too much time.
Hey I don’t know if you still need this but Google now how’s an advance glossary feature with let’s you set a predefined custom definition like you described.
the ratio is broken
How can we use this to translate an HTML page?
very helpful for app I am making
how to use this for dataset column please guide
you can select the entire column by using df['column_name'] = df['Orginalcolumn'].apply(translator.translate, src='en', dest='hi').apply(getattr, args=('text',))
Thanks from Russia
Helpful! Thanks!
im sorry but your mic pick up too much high frequency making it unpleasant to hear. but good tutorial anyway!
no longer working.
دمت گرم
very excellent
thank you.
Nice to see Turkish
If you want the translated text do translator.translate(text2).text
no longer works
the error i keep getting TypeError: translate() missing 1 required positional argument: 'text'
Ah yes. You need to put in the text you want to translate. For example:
import googletrans
from googletrans import Translator
translator = Translator()
result = translator.translate("Hola", dest="en")
print(result)
The translator.translate requires you to put in the text you want to translate, and what language you want to translate it to. This program should print out an array, and in the array, one of the elements should be: text=hello
I hope this helped!
views are way more than the likes
Can u pls make a video on how to photo upload n nested serialiser by django rest API
The S sound is hurting my ears
is it free?
Yes it is!
Just type “pip install googletrans==4.0.0-rc1” in your terminal and wait for it to install. Then it will be free to use!
+1
Kanka bir soru sorabilir miyim?
@@alifurkan3106 Sorabilirsin ;)
im turkish :)) 3:01
How can I translate a text file using this api
you can use files
for example, you could say
filevar = open("filename.txt", r)
#iterate through file
#create list to append characters to
lst = []
for characters in filevar:
#adds characters to list
lst.append(characters)
#join list
words = lst.join("")
words is a string, so now you can use the googletranslate api.
translator = Translator()
translation = translator.translate(words, dest="en") #converts whatever language the file is, to english
print(translation)
The entire code would be:
import googletrans
from googletrans import Translator
translator = Translator()
filevar = open("filename.txt", r)
#iterate through file
#create list to append characters to
lst = []
for characters in filevar:
#adds characters to list
lst.append(characters)
#join list
words = lst.join("")
translator = Translator()
translation = translator.translate(words, dest="en") #converts whatever language the file is, to english
print(translation)
#----------------------------------------------------------------------------
Now say you wanted to replace the file with the translated text. You could do this by overwriting the file. This would be done by running the following code:
import googletrans
from googletrans import Translator
translator = Translator()
filevar = open("filename.txt", "r") #reads file
#iterate through file
#create list to append characters to
lst = []
for characters in filevar:
#adds characters to list
lst.append(characters)
filevar.close() #closes the file because you are done using it
#join list
words = lst.join("")
translator = Translator()
translation = translator.translate(words, dest="en") #converts whatever language the file is, to english
filevar1 = open("filename.txt", "w") #instead of reading file, its going to write in the file. If you wanted to add content to the current file, you could use "a" instead of "w". "a" stands for append.
filevar1.write(words) #overwrites the file and replaces the old text with the new translated text
filevar1.close()
#-------------------------------------------------------------------------
you can now view the file and hopefully there should be new text
note: i haven't run any of this code yet. There might be a few errors but I hope this gave you an idea of what you can do.
Hope this helped!