Python can’t find module NLTK

On OS X you could have multiple installation of Python, so investigate it first:

$ which python python2 python3
/usr/bin/python
/usr/local/bin/python3

$ which pip pip2 pip3
/usr/local/bin/pip
/usr/local/bin/pip2
/usr/local/bin/pip3

All within /usr/bin are built-in and all other in /usr/local/bin are external installed by Homebrew or some other package manager.

If you’re using pip or pip3 from /usr/local, then you’ve to use the same Python instance, otherwise they’re different instances.

Just install it via pip:

pip install nltk

or for Python 3:

pip3 install nltk

then run the right Python instance from /usr/local/bin or update your PATH system variable.

Leave a Comment