new member; advice about NLTK 3.2.3

51 views
Skip to first unread message

Stan Szpakowicz

unread,
May 20, 2017, 6:03:07 AM5/20/17
to nltk-users
I should have introduced myself when I posted the first time. Sorry.

I am a retired university professor. I have taught NLP for a good 30 years, but never using NLTK. Now that is coming my way too. I wanted to install the latest version, but ran into an error, described in my preceding message:

= = = = = = = =

[...] I want to install NLTK (version 3.2.3, the newest and best?)  on a Mac running the latest system 10.12.5. Installation seems to work (what you see is the second run of pip, so everything apparently is already in place). There is, however, an import error. What am I doing wrong? Thanks!

$ sudo -H pip install -U nltk
Password:
Requirement already up-to-date: nltk in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
Requirement already up-to-date: six in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from nltk)

$ python3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk/__init__.py", line 128, in <module>
    from nltk.chunk import *
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk/chunk/__init__.py", line 157, in <module>
    from nltk.chunk.api import ChunkParserI
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk/chunk/api.py", line 13, in <module>
    from nltk.parse import ParserI
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk/parse/__init__.py", line 81, in <module>
    from nltk.parse.corenlp import CoreNLPParser, CoreNLPDependencyParser
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk/parse/corenlp.py", line 17, in <module>
    import requests
ImportError: No module named 'requests'
>>>

= = = = = = = =

I kind of suspect version 3.2.3, because as soon as I reverted to version 3.2.1, everything worked like a charm.

Cheers,

Stan


Steven Bird

unread,
May 20, 2017, 6:13:10 PM5/20/17
to nltk-users
Sorry about this problem. I am testing an update, NLTK 3.2.4, which fixes the problem by removing the dependency on the requests module, cf https://github.com/nltk/nltk/pull/1727

In the meantime you can avoid the problem by manually installing Python's "requests" package.

-Steven Bird

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages