Issue
I'm using this code to translate the string 'Hola mundo':
text = 'Hola mundo'
from googletrans import Translator
Translator().translate(text)
But I obtain this error:
AttributeError: 'NoneType' object has no attribute 'group'
I'm using Jupyter Notebook with Python version 3.9 and pip version 21.2.4.
Could someone help me with this issue? Thank you in advance!
Solution
It works for me using version 4.0.0rc1
. You can find a list of all versions here.
from googletrans import Translator
Translator().translate("Hola mundo").text # Output: 'Hello World'
The stable version 3.0.0
returns your error, which is a known bug.
Answered By - Confused Learner
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.