I am using python 3.5.2 inside the pycharm IDE on Windows 7 and I am unable to import the nltk package.
import nltk
gives the following error:
Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "C:\Python\nltk practice.py", line 7, in <module> from nltk.tokenize import sent_tokenize, word_tokenize File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.2.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ImportError: No module named 'nltk.tokenize'; 'nltk' is not a package
nltk seems to be installed correctly. When i run in terminal
following:
pip install nltk
I get:
Requirement already satisfied (use --upgrade to upgrade): nltk in c:\users\leee\appdata\local\programs\python\python35-32\lib\site-packages
When I run PATH in terminal or sys.path in python console,
C:\Users\leee\AppData\Local\Programs\Python\Python35-32\Lib\site-packages appears in a long list. This is where all my other packages and other packages are installed, which all are imported properly.
I'm pretty confused right now and all help is appreciated.
Lee88 source share