Why am I getting a ModuleNotFoundError when using googletrans

Shoto picture Shoto · Feb 21, 2019 · Viewed 7.5k times · Source

I have pip installed googletrans and more or less copied this code off a video but for some reason it cannot find the module.

from googletrans import Translator
text=("How to convert some text to multiple languages")
destination_langauge={
    "Spanish": "es",
    "Chinese":"zh-CN",
    "Italian":"it"}
translator=Translator()
for key, value in destination_language.item():
    print(tranlator.translate(text, dest=value).text)

Any help will be greatly appreciated because I am struggling

Answer

Dani picture Dani · Jan 8, 2021

I think you need to pip install googletrans for you system python means you can deactivate the virtual environment and pip install googletrans and then activate the virtualenv again.