Module not found error: No module named 'nltk' on OS X 10.14

I am still somewhat new to Python programming. Having read the contributions to this topic, I am still stuck:

I have Python 3.7.4 installed (with Homebrew) on OS X 10.14. In terms of the path everything looks fine:

which python3
/usr/local/bin/python3

I installed nltk with pip, using:

sudo pip3 install nltk

However, when I run python Python 3.7 and enter

import nltk

it says

Module not found error: No module named 'nltk' 

Any help would be greatly appreciated as I can't find any solutions that will work on my Mac.

1 Answer

I found the solution on this website. All I needed to do was to install nltk without sudo, so just

pip3 install -U nltk 

If anyone has wisdom to share why this might work, I'd still greatly appreciate it!

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like