1

in the idle python 3.5.1

>>>from nltk.corpus import gutenberg
>>>no error

but in the pycharm it is throwing error

ImportError: No module named 'nltk.corpus'; 'nltk' is not a package

previously same thing was working fine , but then I did invaidate caches/restrart for no good reason and then its throwing this error. I have checked project interpreter setting its 3.5.1 there also. Any help is appreciable.

Vikas
  • 432
  • 5
  • 18
  • have you looked at the advice [here](http://stackoverflow.com/questions/23570182/error-importing-nltk-on-pycharm)? – patrick Jun 09 '16 at 17:02
  • 1
    @patrick I did silly mistake , I created a new file named as nltk.py in the same project , where I needed the nltk(the toolkit) , just saw it and after removal it started working fine :) – Vikas Jun 10 '16 at 06:08

1 Answers1

0

You'll have to install 'nltk' package for Pycharm. Go to Settings>Project_Name>Project Interpreter. Click on the '+' button and search for 'nltk' and install it. It'd work after that.

Anzar
  • 35
  • 7
  • 1
    I did silly mistake , I created a new file named as nltk.py in the same project , where I needed the nltk(the toolkit) , just saw it and after removal it started working fine :) – Vikas Nov 17 '19 at 16:12