Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AttributeError: 'NoneType' object has no attribute 'group' while using googletrans library

everything work before but it error now when i try using googletrans library. here my code

import googletrans    
from googletrans import Translator

translator = Translator()
df['data'] = df['tweet'].apply(lambda x: translator.translate(x, dest='en').text)
0 tweet
0 Heureusement que Macron n’a pas profité de la guerre en Ukraine pour être réélu mdr
1 L’Ukraine Ce pays formidable N’est-ce pas Macron le fou

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

your code work properly for me. make sure you have the latest googletrans version or 4.0.0-rc1.

here for check your googletrans version

pip freeze

and here for install googletrans version 4.0.0-rc1

install googletrans==4.0.0-rc1
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading