Skip to content Skip to sidebar Skip to footer

Python Nltk Pos_tag Throws Urlerror

I was trying to use the pos_tag function in NLTK 3 (on Windows), but this error popped up: >>> import nltk >>> tokens = nltk.word_tokenize('This is a sentence!')

Solution 1:

EDITED

This issue has been resolved from NLTK v3.2.1. Upgrading your NLTK would resolve the issue, e.g. pip install -U nltk.


You might be using nltk verion 3.2 . Downgrade it to version 3.1 and it will work fine. I myself used the undermentioned method right now and the URL error is gone. Seems like an issue with nltk_version-3.2

Browse to this directory on your computer

C:\Users\USERNAME\AppData\Local\Continuum\Anaconda2\Lib\site-packages
         ORC:\python2.7\site-packages\

Basically the aim is to go into site-packages directory, which holds the installed packages.

Search and delete these files and directories :

nltk-3.1.dist-info
nltk

After deleting force install older version as :-

pip install nltk==3.1

Post a Comment for "Python Nltk Pos_tag Throws Urlerror"