python cannot find modules in installed textstat

Viewed 2860

I've installed textstat via pip. (And I've uninstalled and re-installed, with the same failure).

C:\Anaconda>pip install textstat
Collecting textstat
Using cached textstat-0.3.1.tar.gz
Installing collected packages: textstat
Running setup.py install for textstat ... done
Successfully installed textstat-0.3.1

When I try to run any function from textstat: ipython (and python) reports that the module cannot be found.

Can you suggest ways to troubleshoot?

In [1]: from textstat import textstat
In [2]: print textstat.syllable_count("Here is some text. Here is some more.")

    AttributeError                            Traceback (most recent call last)
    <ipython-input-2-7ac2bb0cb31e> in <module>()
    ----> 1 print textstat.syllable_count("Here is some text. Here is some more.")

    AttributeError: 'module' object has no attribute 'syllable_count'

Also, ipython reports that the module exists:

In [3]: ??textstat

    Type:        module
    String form: <module 'textstat.textstat' from 'C:\Anaconda\lib\site-packages\textstat\textstat.pyc'>
    File:        c:\anaconda\lib\site-packages\textstat\textstat.py
    Source:
    from __future__ import print_function
    import pkg_resources
    import string
    import re
    import math
    import operator

    exclude = list(string.punctuation)
    easy_word_set = set([ln.strip() for ln in pkg_resources.resource_stream('textstat', 'easy_words.txt')])

    ...
    class textstatistics:
    ...
    def syllable_count(self, text):
        """
        Function to calculate syllable words in a text.
        I/P - a text
        O/P - number of syllable words
        """
    ...
1 Answers
Related