Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'subject:Python': 0.06; 'cursor': 0.09; 'matplotlib': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'responsive': 0.09; 'sentence': 0.09; 'python': 0.11; '...,': 0.16; '3],': 0.16; 'backend.': 0.16; 'doing:': 0.16; 'guessing': 0.16; 'herman': 0.16; 'holy': 0.16; 'inaugural': 0.16; 'it),': 0.16; 'numpy': 0.16; 'pylab': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'sensibility': 0.16; 'subject:Language': 0.16; 'url:faq': 0.16; 'language': 0.16; 'wrote:': 0.18; 'module': 0.19; 'trying': 0.19; 'examples': 0.20; 'seems': 0.21; 'command': 0.22; '>>>': 0.22; 'example': 0.22; 'import': 0.22; '(in': 0.22; 'saying': 0.22; 'load': 0.23; 'header :User-Agent:1': 0.23; 'error': 0.23; 'errors.': 0.24; 'subject: .': 0.24; "haven't": 0.24; "i've": 0.25; 'chapter': 0.26; 'header:X-Complaints-To:1': 0.27; 'installed': 0.27; 'errors': 0.30; "i'm": 0.30; 'getting': 0.31; '>>>>': 0.31; 'fine,': 0.31; 'loading': 0.31; 'run': 0.32; 'another': 0.32; 'text': 0.33; '(e.g.': 0.33; 'becomes': 0.33; 'mac': 0.33; 'sense': 0.34; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'display': 0.35; 'something': 0.35; 'but': 0.35; "didn't": 0.36; 'method': 0.36; 'url:org': 0.36; 'so,': 0.37; 'list': 0.37; 'window': 0.38; 'to:addr:python-list': 0.38; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'commands': 0.60; 'skip:t 30': 0.61; 'new': 0.61; 'first': 0.61; 'address': 0.63; 'name': 0.63; 'choose': 0.64; 'more': 0.64; 'wall': 0.65; 'here': 0.66; 'close': 0.67; 'natural': 0.68; 'gotten': 0.74; '...and': 0.84; '1908': 0.84; 'forward,': 0.84; 'genesis': 0.84; 'journal': 0.84; 'personals': 0.84; 'subject:nothing': 0.84; '2013,': 0.91; '***': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Natural Language Processing with Python .dispersion_plot returns nothing Date: Mon, 17 Jun 2013 19:42 +0200 Organization: None References: <05bb0af7-a20b-4b89-92bb-ff25ebd6919e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p508483be.dip0.t-ipconnect.de User-Agent: KNode/4.7.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 61 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371490883 news.xs4all.nl 15900 [2001:888:2000:d::a6]:59324 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48543 sixtyfourbit wrote: > I'm in the first chapter of Natural Language Processing with Python and am > trying to run the example .dispersion_plot. I am using Python 2.7.4 > (Anaconda) on Mac OSX 10.8. > > When I load all of the necessary modules and try to create the dispersion > plott, I get no return - no plot, no error message, not even a new >>> > prompt, just a blinking cursor under the last line I typed. Here is what > I've been doing: > > [~]: python > Python 2.7.4 |Anaconda 1.5.1 (x86_64)| (default, May 9 2013, 12:12:00) > [GCC 4.0.1 (Apple Inc. build 5493)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import numpy >>>> import matplotlib >>>> import nltk >>>> from nltk.book import * > *** Introductory Examples for the NLTK Book *** > Loading text1, ..., text9 and sent1, ..., sent9 > Type the name of the text or sentence to view it. > Type: 'texts()' or 'sents()' to list the materials. > text1: Moby Dick by Herman Melville 1851 > text2: Sense and Sensibility by Jane Austen 1811 > text3: The Book of Genesis > text4: Inaugural Address Corpus > text5: Chat Corpus > text6: Monty Python and the Holy Grail > text7: Wall Street Journal > text8: Personals Corpus > text9: The Man Who Was Thursday by G . K . Chesterton 1908 >>>> text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", >>>> "America"]) > > ...and nothing. I can't paste it but my cursor is just blinking under my > last command with no prompt. So far the other example commands from the > chapter (e.g. .concordance) work fine, so I'm guessing the problem is > something with numpy or matplotlib. I had a heck of a time getting > matplotlib installed correctly (kept getting errors saying that it wasn't > installed even when I had installed it), but since switching to the > Anaconda distro, which had those prepackaged, I haven't gotten any module > errors. > > Any advice?? The dispersion_plot() method uses pylab.show() to display the data (in another window). Only when you close that window the interactive interpreter becomes responsive again. If you didn't overlook that window: do you run into the same problem with >>> import pylab >>> pylab.plot([1, 2, 3], [3, 1, 2]) [] >>> pylab.show() ? If so, choose another backend. I've not tried, but it seems straight- forward, see