-1
from nltk import stopwords 
print(stopwords.words('english'))

Second line is giving error which is

Traceback (most recent call last):
  File "<pyshell#16>", line 1, in <module>
    print(stopwords.words('english'))
AttributeError: 'module' object has no attribute 'words'

I have installed nltk using pip install nltk then i downloaded stopwords using command nltk.download('stopwords'), after unzipping that "stopwords" folder I placed that in python34/lib/site-packeges/nltk/stopwords

How can i get stopwords from this?

awesoon
  • 32,469
  • 11
  • 74
  • 99
Muhammad Zeeshan
  • 470
  • 7
  • 24
  • The module name is `nltk.corpus.stopwords` as shown in [the NLTK documentation](http://www.nltk.org/book/ch02.html#wordlist-corpora). Try that instead. – msw Jan 03 '16 at 10:15
  • You say "after unzipping that "stopwords" folder I placed that in python34/lib/site-packeges/nltk/stopwords". Don't do that, put it where it belongs. – msw Jan 03 '16 at 10:17

1 Answers1

2

As mentioned in the comment, try

from nltk.corpus import stopwords

That should fix the error.

aliasm2k
  • 883
  • 6
  • 12