Python Forum
ModuleNotFoundError: No module named 'stop_words'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'stop_words'
#1
am trying to run this code but am getting this error

from __future__ import division
from sklearn.model_selection import train_test_split
from stop_words import get_stop_words
import matplotlib.pyplot as plt
from collections import Counter
import pandas as pd
import numpy as np
import string
import re


error

ModuleNotFoundError: No module named 'stop_words'
Reply
#2
stop-words is not a built-in module.
You'll need to install it before you can use it
Reply
#3
i have tried am using jupyter

from stop_words import get_stop_words

stop_words = get_stop_words('en')
stop_words = get_stop_words('english')

from stop_words import safe_get_stop_words

stop_words = safe_get_stop_words('unsupported language')



but still getting this error



---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-5-62c73f478eb9> in <module>
----> 1 from stop_words import get_stop_words
2
3 stop_words = get_stop_words('en')
4 stop_words = get_stop_words('english')
5

ModuleNotFoundError: No module named 'stop_words'
Reply
#4
How did you try to install it?
Looks like it didn't work.
Reply
#5
Basic install.
# pip version(newest 19.1.1)and version of Python that stop-words get installed to python 3.7
λ pip -V
pip 19.1.1 from c:\python37\lib\site-packages\pip (python 3.7)

# install
E:\div_code\read
λ pip install stop-words
Collecting stop-words
  Downloading ...........
Installing collected packages: stop-words
Successfully installed stop-words-2018.7.23

# Test that it work
E:\div_code\read
λ python
>>> import stop_words
>>>
>>> stop_words.__VERSION__
(2018, 7, 23)
>>> exit()
Reply
#6
am using Jupyter for anaconda
Reply
#7
It's the same way,i do in Scripts folder where pip and conda is placed.
If Anaconda is set in Windows Path,then it will work from anywhere in cmd.
G:\Anaconda3\Scripts
λ pip -V
pip 19.0.3 from G:\Anaconda3\lib\site-packages\pip (python 3.7)

G:\Anaconda3\Scripts
λ pip install stop-words
Collecting stop-words
Installing collected packages: stop-words
Successfully installed stop-words-2018.7.23

G:\Anaconda3\Scripts
λ cd ..

G:\Anaconda3
λ python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
>>> import stop_words
>>>
>>> stop_words.__VERSION__
(2018, 7, 23)
Anaconda and other ways to run Python
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Keras. ModuleNotFoundError: No module named 'error' agatte 1 7,061 Sep-18-2019, 12:27 PM
Last Post: shivani
  ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' rajeev1729 1 24,364 Jul-04-2018, 06:26 PM
Last Post: stpaulchuck
  No module named pip Viesturs 4 49,636 Jun-08-2018, 06:41 AM
Last Post: volcano63
  No module named scipy kirill 2 9,379 Mar-16-2018, 04:19 PM
Last Post: kirill
  ModuleNotFoundError: No module named 'adspy_shared_utilities' POOJASWAMY 0 8,152 Feb-09-2018, 05:46 AM
Last Post: POOJASWAMY
  No module named numpy rdx 7 59,051 Sep-24-2017, 07:12 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020