Search code examples
pythonnlpimporterror

No module named 'google trans'


I've got warning while installing the pip googletrans.

The warning says in the picture:

The warning says in the picture

Does it affect my code? the error says "No module named 'google trans'?

error-screenshot:

error-screenshot

from tkinter import *
import googletrans
import textblob
from tkinter import ttk, messagebox

root = Tk ()
root.title('Codemy.com - Translator')
root.geometry("880x300")

def translate_it():
    pass

# Text Boxes
original_text = Text(root, height=10, width=40)
original_text.grid(row=0, column=0, pady=20, padx=10)

translate_button = Button(root, text="Translate!", font=("Helvetica", 24), command=translate_it)
translate_button.grid(row=0, column=1, padx=10)

translated_text = Text(root, height=10, width=40)
translated_text.grid(row=0, column=2, pady=20, padx=10)

root.mainloop()

Solution

  • Check if the directory of the googletrans module and make sure it's within the list. You can check the directories that python reads with:

    import sys
    sys.path
    

    You can add the directory of googletrans with:

    sys.path.append('/Users/name/Documents')