[Python] python error: ModuleNotFoundError: No module named 'NLTK'

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    Using Ubuntu terminal, when I type python then write import nltk, the package does work, but when I use the 'import nltk' inside a .py file , and run the command : python pyfile.py, I get this message: error: ModuleNotFoundError: No module named 'NLTK'

    I tried nearly everything from installing pip3 to reinstalling nltk in python3, what could be the problem? note I am using python 3.6

    Here is the code:

    from NLTK.corpus import stopwords
    stopWords = stopwords.words('english')
    vectorizer = CountVectorizer(stop_words = stopWords)

    Continue reading...

Compartilhe esta Página