Narendra kumawat
Narendra kumawat

Reputation: 137

ModuleNotFoundError: No module named 'sentiment_mod'

I am using nltk sentiment_mod but python is throwing module not found error

from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import sentiment_mod as sen_mod

the error is

ModuleNotFoundError                
      Traceback (most recent call last)
      2 from tweepy import OAuthHandler
      3 from tweepy.streaming import StreamListener
----> 4 import nltk.sentiment_mod as sen_mod
      5 import json
      6 

ModuleNotFoundError: No module named 'sentiment_mod'

Upvotes: 0

Views: 2568

Answers (2)

SaNa
SaNa

Reputation: 343

"sentiment_mod" seems to be a file name for a sentiment analysis module that were created before and is called here in your code. A good example for this can be: https://pythonprogramming.net/sentiment-analysis-module-nltk-tutorial/

Upvotes: 0

ivan_pozdeev
ivan_pozdeev

Reputation: 36116

There's no such module in ntlk. Judging by the name, it's some private modification of ntlk.sentiment. Consult wherever you got this code from how to use it. Maybe there are some additional requirements, or it's simply obsolete.

Upvotes: 2

Related Questions