I can import the nltk package when running python or ipython from bash. So, nltk is definitely installed somewhere (in python from bash,
nltk.__file__
is
/home/nadine/anaconda2/lib/python2.7/site-packages/nltk/__init__.pyc
)
However, when using Jupyter Notebook (which I installed using Anaconda, with the 2.7 version of python), importing nltk fails:
import nltk
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-b06499430ee0> in <module>()
----> 1 import nltk
ImportError: No module named nltk
In Jupyter Notebook, sys.executable
yields /home/nadine/.conda/envs/py27/bin/python
, while in python from bash it yields /home/nadine/anaconda2/bin/python2.7
What exactly is going wrong here and how can I fix it?