Michael Blane
Michael Blane

Reputation: 113

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

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

Upvotes: 1

Views: 2074

Answers (2)

ShadowProgrammer
ShadowProgrammer

Reputation: 82

Use googletrans version 3.1.0a0 or above.

Upvotes: 1

Joep
Joep

Reputation: 834

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.

Upvotes: 1

Related Questions