Supreeth Meka Supreeth Meka - 4 months ago 191
Python Question

Resource u'tokenizers/punkt/english.pickle' not found

My Code:

tokenizer ='nltk:tokenizers/punkt/english.pickle')

ERROR Message:

[ec2-user@ip-172-31-31-31 sentiment]$ python
Traceback (most recent call last):
File "", line 16, in <module>

tokenizer ='nltk:tokenizers/punkt/english.pickle')

File "/usr/lib/python2.6/site-packages/nltk/", line 774, in load

opened_resource = _open(resource_url)

File "/usr/lib/python2.6/site-packages/nltk/", line 888, in _open

return find(path_, path + ['']).open()

File "/usr/lib/python2.6/site-packages/nltk/", line 618, in find

raise LookupError(resource_not_found)


Resource u'tokenizers/punkt/english.pickle' not found. Please
use the NLTK Downloader to obtain the resource:


Searched in:
- '/home/ec2-user/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
- u''

I'm trying to run this program in Unix machine:

As per the error message, I logged into python shell from my unix machine then I used the below commands:

import nltk

and then I downloaded all the available things using d- down loader and l- list options but still the problem persists.

I tried my best to find the solution in internet but I got the same solution what I did as I mentioned in my above steps.


I got the solution:

import nltk

once the NLTK Downloader starts

d) Download l) List u) Update c) Config h) Help q) Quit

Downloader> d

Download which package (l=list; x=cancel)? Identifier> punkt