Commit a1d30e00 by Ewan Klein

add check for twython import

parent e5c28cc6
...@@ -13,6 +13,14 @@ This package contains classes for retrieving Tweet documents using the ...@@ -13,6 +13,14 @@ This package contains classes for retrieving Tweet documents using the
Twitter API. Twitter API.
""" """
try:
from twython import Twython, TwythonStreamer
except ImportError as err:
import textwrap
MSG = """The NLTK twitterclient module requires the Twython package. See\
https://twython.readthedocs.org/ for installation instructions."""
err.msg = textwrap.fill(MSG)
raise
from nltk.twitter.util import credsfromfile from nltk.twitter.util import credsfromfile
from nltk.twitter.twitterclient import Streamer, Query, Twitter, TweetViewer,\ from nltk.twitter.twitterclient import Streamer, Query, Twitter, TweetViewer,\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment