Reputation: 3347
I installed nltk
and seemed to successfully install. But when I try to import it, it says no module named nltk
. However, when I try to reinstall it, it says requirement already satisfied. How could that be the case? What can I do to fix this? Thanks!
Additionally if I try to import nltk
using python shell (under the same virtual environment that I am running the jupyter notebook from), I get the following:
Upvotes: 2
Views: 1545
Reputation: 39930
It seems to be a problem to with the version of Python Jupyter is currently pointing to.
To fix the issue, make sure that both jupyter and pip are running under the same environment. For example, compare which python
and pip -V
Also make sure that Python is pointing to the right path:
In your Jupyter Notebook, the output of
import sys
sys.version
should match your python version:
python --version
Upvotes: 2