Registry / ai-ml / textblob

textblob

JSON →
library0.20.1pypypi✓ verified 29d ago

TextBlob is a Python library designed for processing textual data, providing a simplified API for common Natural Language Processing (NLP) tasks. It encompasses functionalities like sentiment analysis, part-of-speech tagging, noun phrase extraction, and more, building on top of NLTK and pattern libraries. The current version is 0.20.0, with a release cadence that indicates active maintenance and updates, as seen with recent releases in late 2025 and early 2026.

pip install textblob
INSTALL
IMPORT
SIG · TEXTBLOB
T
textblob
ai-mlpythonv0.20.1
Install
3.5s avg
Import
818ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.858s · 39.6MB
glibc
py 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.
fix
Run `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`.
fix
Update 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.
fix
Rename 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`.
fix
Ensure correct casing: `from textblob import TextBlob`.
affects: All versions
breakingSupport for Python 3.4 was officially dropped.
fix
Upgrade 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.
fix
Use 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()`.
fix
Call `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.
fix
python -m textblob.download_corpora
ModuleNotFoundError: No module named 'textblob'
The TextBlob library is not installed in the Python environment being used.
fix
pip install textblob
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.
fix
Access 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.
fix
Ensure 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.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources