Install & Compatibility
Where this runs
tested against v0.20.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.858s · 39.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.778s · 41MB
39MB installed
● package 39MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TextBlob
✓ from textblob import TextBlob
TextBlob (legacy)
✓ from textblob import TextBlob
✗ from text.blob import TextBlob
The core package was renamed from 'text' to 'textblob' in version 0.8.0. Older imports will fail.
TextBlob (casing)
✓ from textblob import TextBlob
✗ from textblob import textblob
Python is case-sensitive; the class name is 'TextBlob' (capital T and B).
This quickstart demonstrates basic sentiment analysis, part-of-speech tagging, and noun phrase extraction using TextBlob. It initializes a TextBlob object with a string and then accesses its `sentiment`, `tags`, and `noun_phrases` properties.
from textblob import TextBlob
text = "TextBlob is amazingly simple to use. What great fun!"
blob = TextBlob(text)
print(f"Original text: {text}")
print(f"Sentiment Polarity: {blob.sentiment.polarity}") # Range [-1.0, 1.0]
print(f"Sentiment Subjectivity: {blob.sentiment.subjectivity}") # Range [0.0, 1.0]
print(f"Part-of-speech tags: {blob.tags}")
print(f"Noun phrases: {blob.noun_phrases}")
# Example of a common warning: not downloading corpora leads to LookupError
# Run `python -m textblob.download_corpora` if you get a LookupError.
Debug
Known issues
gotchaFailing to download NLTK corpora will result in `LookupError` when performing NLP tasks (e.g., sentiment analysis, POS tagging). This is a very common initial setup mistake.fixRun `python -m textblob.download_corpora` after installation. For minimal corpora, use `python -m textblob.download_corpora lite`.
affects: All versions
breakingThe main package import path changed from `from text.blob import TextBlob` to `from textblob import TextBlob`.fixUpdate import statements from `text.blob` to `textblob`.
affects: <=0.7.1 to >=0.8.0
gotchaNaming your Python script file `textblob.py` can cause an import collision, leading to `AttributeError` or `ImportError` because Python will try to import your local file instead of the installed library.fixRename your script file to something other than `textblob.py` (e.g., `my_script.py`).
affects: All versions
gotchaThe main class is `TextBlob` (capital 'T' and 'B'). Using `textblob` (lowercase) in the import statement will result in an `ImportError` or `AttributeError`.fixEnsure correct casing: `from textblob import TextBlob`.
affects: All versions
breakingSupport for Python 3.4 was officially dropped.fixUpgrade to Python 3.7 or newer. TextBlob 0.20.0 requires Python >=3.10.
affects: >=0.16.0
deprecatedThe `clean_html` parameter has been deprecated. It was removed as it was also deprecated in NLTK.fixUse a dedicated HTML parsing library like Beautiful Soup (`BeautifulSoup(html_doc).get_text()`) for HTML cleaning.
affects: >=0.6.0
breakingThe `TextBlob.json` property was changed to a method `TextBlob.json()`.fixCall `json()` as a method: `blob.json()` instead of accessing it as a property `blob.json`.
affects: >=0.11.0
Errors
Common errors & fixes
NLTK tokenizers and taggers are not available. Please run `python -m textblob.download_corpora` or install the `pattern` library.
TextBlob requires NLTK corpora and data from its bundled 'pattern' library, which are not included in the default installation and must be downloaded separately.
fixpython -m textblob.download_corpora
ModuleNotFoundError: No module named 'textblob'
The TextBlob library is not installed in the Python environment being used.
AttributeError: 'WordList' object is not callable
The user attempted to call a TextBlob property (like `blob.words` or `blob.sentences`) as if it were a method, but it is an attribute that returns a list-like object directly.
fixAccess the property without parentheses, for example: `for word in blob.words:`
textblob.exceptions.TranslatorError: There was an error translating the text.
TextBlob's translation feature relies on an external API (Google Translate) and this error occurs if there is no internet connection, the API is unreachable, or the translation request fails.
fixEnsure you have an active internet connection and that the external translation service is available.
Upgrade
Version history
0.20.1latest on PyPI · released Jul 18, 2026
Audit
Dependencies
NLTKrequiredTextBlob relies on NLTK for core NLP functionalities; it is automatically installed but requires separate corpus downloads.
numpyoptionalRequired for certain advanced features like the maximum entropy classifier, but not for basic usage.