Cannot import nltk under OSX

2019-09-01 05:51发布

I use pip install -U nltk to install it. After pip list I can get nltk (3.0.0). Also sys.path includes location of nltk.

But when run import nltk, it shows ImportError: No module named nltk

I use OSX Yosemite, python2.7

I cannot figure out why it happen. Thank you for any suggestion.

1条回答
等我变得足够好
2楼-- · 2019-09-01 06:26

You might want to try the free Anaconda distribution of Python instead. NLTK comes pre-installed in Anaconda, along with many other popular packages for data analysis, etc. It's a lot easier than having to install & manage hundreds of separate packages individually.

https://store.continuum.io/cshop/anaconda/

查看更多
登录 后发表回答