py-googletranslation
py-googletranslation copied to clipboard
ImportError: cannot import name 'TranslatedPart' from 'googletrans.models'
Could anyone please fix the following import error when running "from pygoogletranslation import Translator"? Thanks a lot.
"ImportError: cannot import name 'TranslatedPart' from 'googletrans.models' (/usr/local/lib/python3.7/dist-packages/googletrans/models.py)"
I have the same problem, did you solve that?
pip install googletrans==4.0.0-rc1
this can work
- cd the following path
YOUR PYTHON INSTALL PATH /lib/site-packages/pygoogletranslation/utils.py
- comment the code
from googletrans.models import TranslatedPart (about 8th line)
- write new import
from pygoogletranslation.models import TranslatedPart
- cd the following path
YOUR PYTHON INSTALL PATH /lib/site-packages/pygoogletranslation/utils.py
- comment the code
from googletrans.models import TranslatedPart (about 8th line)
- write new import
from pygoogletranslation.models import TranslatedPart
Thanks! It worked.
This is the error of old import name, and only this.
Due to this, everyone must change to fix his or her code downloaded. This is what the developer should do.
and, it dups with #26.