0

Here is my code about sentiment analysis in python so I had a problem on jupyter lab error is no module name but I had everything about the installing part pip install vaderSentiment and enviroment variable stuff. So What should I do?

from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()

def sentiment_analyzer_scores(sentence):
    score = analyser.polarity_scores(sentence)
    print("{:-<40} {}".format(sentence, str(score)))



 ModuleNotFoundError                       Traceback (most recent call last)
    <ipython-input-22-f1fda500aee5> in <module>
    ----> 1 from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
          2 analyser = SentimentIntensityAnalyzer()
          3 
          4 def sentiment_analyzer_scores(sentence):
          5     score = analyser.polarity_scores(sentence)
    
    ModuleNotFoundError: No module named 'vaderSentiment'
  • Did you install that module? If yes, are you sure that you installed it in the correct environment? – krassowski May 09 '21 at 16:29
  • Yes, installing is done "Requirement already satisfied" and my enviroment variables python\Scripts pip path adding but still doesn't work –  May 09 '21 at 16:36
  • This is to few details. You would need to explain your environment in details, providing information on: where is the JupyterLab installed, how you start it, whether you use conda or not, etc. Also, have you tried the answers in https://stackoverflow.com/questions/25607837/pip-install-not-installing-into-correct-directory? – krassowski May 09 '21 at 16:49

1 Answers1

1

Try installing its full master branch zip file and unzip it in your main file location then either try importing the same way you did or try this other line of code to import it.

from vaderSentiment import SentimentIntensityAnalyzer

Also check if you have only one version of python installed and not multiple.

Do try to upgrade pip, python and vaderSentiment to latest versions.

pip install --upgrade vaderSentiment