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

problem with googletrans and 'the cat sat on the mat' #57

Open
franzko03 opened this issue Feb 26, 2021 · 2 comments
Open

problem with googletrans and 'the cat sat on the mat' #57

franzko03 opened this issue Feb 26, 2021 · 2 comments

Comments

@franzko03
Copy link

after installing with 'pip install googletrans' to the anaconda env for pytorch
the line:
sentences = ['The cat sat on the mat']
translations_fr = translator.translate(sentences, dest='fr')

throws an error:
File "myuser\anaconda3\envs\PyTc\lib\site-packages\googletrans\gtoken.py", line 62, in _update
code = self.RE_TKK.search(r.text).group(1).replace('var ', '')

AttributeError: 'NoneType' object has no attribute 'group'

how can i make this nice tool work?!

@MarcusFra
Copy link
Contributor

That error is currently under review, see the package's open issue. I'll open a PR.

--> Please try googletrans==3.1.0a0 instead. It's a temporary fix, but its effectiveness seems to depend on your local environment. Feedback is welcome!

@MarcusFra
Copy link
Contributor

I haven't tried nor tested it, but I've also encountered an alternative (for non-commmercial usage) called google_trans_new: https://github.com/lushan88a/google_trans_new

MarcusFra added a commit to MarcusFra/beginners-pytorch-deep-learning that referenced this issue Mar 29, 2021
MarcusFra added a commit to MarcusFra/beginners-pytorch-deep-learning that referenced this issue Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants