Issues with using nltk library

25 views
Skip to first unread message

Nikita Jain

unread,
Nov 29, 2017, 11:14:12 AM11/29/17
to nltk-users
I have downloaded python 2.7.

Tried also installing nltk.

Now when I write code of import nltk, it shows me below:

>> import nltk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\nltk\__init__.py", line 99, in <module>
    from collocations import *
  File "C:\Python27\lib\site-packages\nltk\collocations.py", line 38, in <module>
    from nltk.metrics import ContingencyMeasures, BigramAssocMeasures, TrigramAssocMeasures
  File "C:\Python27\lib\site-packages\nltk\metrics\__init__.py", line 23, in <module>
    from nltk.metrics.segmentation    import windowdiff, ghd, pk
  File "C:\Python27\lib\site-packages\nltk\metrics\segmentation.py", line 44, in <module>
    import numpy
ImportError: No module named numpy
>>>


Please help.

Thank you,

Dimitriadis, A. (Alexis)

unread,
Nov 29, 2017, 11:30:44 AM11/29/17
to nltk-...@googlegroups.com
If you look at the error, it’s about as clear as Python errors get: The nltk requires the module `numpy`, which you need to install separately. (In http://www.nltk.org/install.html it still says that numpy is “optional”, but that doesn’t seem to be the case; in any event lots of important things require numpy.)

Alexis

--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Denzil Correa

unread,
Nov 30, 2017, 5:29:40 AM11/30/17
to nltk-users
Hi Nikita,

You could also try using the Anaconda Python Distribution. I guess “nltk” is a part of the distribution. Even if it isn’t, it might be easier to install with Anaconda.

--Regards,
Denzil
http://correa.in
--
Reply all
Reply to author
Forward
0 new messages