I can't understand why googletrans in python isn't working, it gives error: AttributeError: 'NoneType' object has no attribute 'group'

Question:

I was just trying to understand how to use googletrans in python and I wrote out the following code:

from googletrans import Translator

translator = Translator() 

result = translator.translate('Mikä on nimesi', src='fi', dest='fr')

print(result.src)
 
print(result.dest)
 
print(result.text)

But for some reason it gives me the error message:

AttributeError: ‘NoneType’ object has no attribute ‘group’

I have installed google translate with pip install googletrans, and was trying to follow the instructions on this site: https://py-googletrans.readthedocs.io/en/latest/ but for some reason it doesn’t work. I’m running on kali linux operating system. Could someone please explain to me how to fix the issue?

Ps: here’s a screenshot of the message:

enter image description here

Asked By: Michael Blane

||

Answers:

Googletrans is currently broken. From the docs can be seen that de build is failing. Seeing a D for maintainability doesn’t look good, but I’m not familiar with this benchmark.

enter image description here

You could try an older version that is passing the build, or fix the issue because it’s open-source.

Answered By: Joep

Use googletrans version 3.1.0a0 or above.

Answered By: ShadowProgrammer