nltk.download() hangs on OS X
Try running nltk.download_shell()
instead as there is most likely an issue displaying the downloader UI. Running the download_shell()
function will bypass it.
I had trouble with this, too, and I ended up with this workaround:
> cd /usr/lib
-- change directory to the desired install directory
> sudo idle
-- run the interactive interpreter as an administrator (superuser do)
At this point the system asks for your password before starting up idle. Then, within idle, the nltk.download() function works fine:
>>> nltk.download()
In my case I was running nlkt.download() in a Jupyter (IPython) notebook on a Mac, and it had opened a window BEHIND the browser window without me knowing. I finally found it by Mission Control (four fingers swipe up). That's why the function was seemingly hanging.