omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Installing NLTK

    Pythonista
    4
    22
    19382
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Rothrock42
      Rothrock42 last edited by

      Playing with it some more I've found that it also wants Tkinter. Depending on which packages you load you might get a warning:

      Documents/site-packages/nltk/draw/__init__.py:14: UserWarning: nltk.draw package not loaded (please install Tkinter library).
      warnings.warn("nltk.draw package not loaded "
      

      So text#.dispersion_plot() won't work, but oddly FreqDist(text#).plot(#) does. Evidently plot uses Matplotlib, but dispersion_plot() uses Tkinter.

      1 Reply Last reply Reply Quote 0
      • Rothrock42
        Rothrock42 last edited by

        Spoke too soon. I changed line 456 in nltk.text.py to

        from nltk.draw.dispersion import dispersion_plot
        

        And now the dispersion_plot works. Not sure what in the draw package requires Tkinter, but that wasn't it.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors