Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'None type' object has no attribute 'group' #398

Closed
heavyweaponsguy11 opened this issue Mar 8, 2024 · 5 comments
Closed

Comments

@heavyweaponsguy11
Copy link

Here is my code:
`import httpcore
setattr(httpcore, 'SyncHTTPTransport', any)
from googletrans import Translator
import time

languages = ['ar', 'bg', 'hu', 'el', 'da', 'iw', 'ky', 'lo', 'mn', 'de', 'pt', 'ro', 'so', 'tt', 'uz', 'fr', 'hr', 'cs', 'sv', 'et', 'ja']

sentence = input('Enter sentence to translate: ')

translator = Translator()

for lang in languages:
translated = translator.translate(sentence, dest=lang)
final_translation = translator.translate(translated.text, src=lang, dest='en')
print(f'Translate to {final_translation.dest}: {final_translation.text}')`

I wanted to make kind of 'funny translator', which takes a sentence, translates it throught different languages, and then shows the result.
But when I run the programm, I'm recieving that error:
AttributeError: 'None type' object has no attribute 'group'
I tryed to run the programm on 4.0.0rc1 and 3.1.0a0, but it's still doesn't works
How can I fix it? (my Python version: 3.10.5)

@jackqt
Copy link

jackqt commented Mar 12, 2024

same here +1

@dartharva
Copy link

#280

@Sungsym
Copy link

Sungsym commented Mar 13, 2024

#280
pip install googletrans==3.1.0a0
it works, thanks a lot

@mercy-git
Copy link

googletrans==3.1.0a0 works when used alone. But it has package dependency error when used along with langchain or llama index. Why is the googletrans latest version so old? What is the alternative or way to fix this?

@JamieShuai
Copy link

using 4.0.0rc1 version right now, yet still got this problem. seems googletrans need updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants