I am using PyCharm and Anaconda. I have installed NTLK with sudo pip install -U nltk
and even to make sure since I'm on Mac OS and I saw this previous SO post to also try pip3 install nltk
.
However, no matter where I try (PyCharm's terminal, Pycharm's Python, or my own terminal), I cannot get import ntlk
to work and always get ModuleNotFoundError: No module named 'ntlk'
.
The weird thing is that I actually manage to run some code with a simple "Python test.py" that contains: from nltk.tag import StanfordPOSTagger
but whenever I try to import ntlk
to be able to then nltk.download('punkt')
I get the No module named 'ntlk'
error.
Would you know where that is coming from?
Edit:
output of
- python -V: Python 3.7.0
- python3 -V: Python 3.7.0
- pip -V: pip 18.0 from /Users/.../lib/python3.7/site-packages/pip (python 3.7)
- pip3 -V: pip 18.0 from /Users/.../lib/python3.7/site-packages/pip (python 3.7)
As for python3 -c "import ntlk; print('ntlk available')"
it returns:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ntlk'
Edit 2:
Output of python -c "import os, sys; print(os.linesep.join(sys.path))"
/Users/.../anaconda3/envs/.../lib/python37.zip /Users/.../anaconda3/envs/.../lib/python3.7 /Users/.../anaconda3/envs/.../lib/python3.7/lib-dynload /Users/.../anaconda3/envs/.../lib/python3.7/site-packages