Registry / aws / ibm-watson

ibm-watson

JSON →
library11.2.0pypypi✓ verified 83d ago

The official Python client library for IBM Watson services, including Speech to Text, Text to Speech, Assistant, Natural Language Understanding, and more. Current version 11.2.0, released January 2026. Maintained actively by IBM.

pip install ibm-watson
INSTALL
IMPORT
SIG · IBM-WATSON
I
ibm-watson
awspythonv11.2.0
Install
4.6s avg
Import
880ms
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v11.2.0 · 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.103.910 runs
installs and imports cleanly · install 0.0s · import 0.924s · 29.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.6s · import 0.836s · 30MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SpeechToTextV1
from ibm_watson import SpeechToTextV1
from watson_developer_cloud import SpeechToTextV1
The old package name 'watson_developer_cloud' is deprecated. Use 'ibm_watson'.
AssistantV2
from ibm_watson import AssistantV2
from ibm_watson.assistant_v2 import AssistantV2
Direct import from ibm_watson is correct; the submodule path is outdated.
TextToSpeechV1
from ibm_watson import TextToSpeechV1
from ibm_watson.text_to_speech import TextToSpeechV1
Use top-level import from ibm_watson.
NaturalLanguageUnderstandingV1
from ibm_watson import NaturalLanguageUnderstandingV1
from ibm_watson.natural_language_understanding import NaturalLanguageUnderstandingV1
Top-level import is preferred.
ApiException
from ibm_cloud_sdk_core import ApiException
from ibm_watson import ApiException
ApiException lives in ibm_cloud_sdk_core, not ibm_watson.

Initialize Speech to Text service with IAM authentication and transcribe an audio file.

from ibm_watson import SpeechToTextV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('your-api-key') stt = SpeechToTextV1(authenticator=authenticator) stt.set_service_url('https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/your-instance-id') # Example: transcribe an audio file with open('audio.wav', 'rb') as audio_file: result = stt.recognize(audio=audio_file, content_type='audio/wav').get_result() print(result)
Debug
Known issues
breakingVersion 11.0.0+ requires 'environmentId' parameter in Assistant V2 'createSession' and 'deleteSession' methods.
fix
Add the 'environmentId' argument when calling create_session() or delete_session().
affects: >=11.0.0
breakingVersion 10.0.0 removed 'interim_results' and 'low_latency' WebSocket parameters from Speech to Text.
fix
Remove these parameters from your recognize_with_websocket() calls.
affects: >=10.0.0
breakingVersion 9.0.0 introduced breaking changes in Discovery V2 batch API endpoints.
fix
Update Discovery V2 code to use the new batches APIs (e.g., list_batches, get_batch).
affects: >=9.0.0
deprecatedOld import paths like 'from watson_developer_cloud import ...' are deprecated and removed in recent versions.
fix
Use 'from ibm_watson import ...' instead.
affects: >=7.0.0
gotchaSpeech to Text WebSocket streaming requires the 'websocket-client' package to be installed separately.
fix
Install websocket-client: pip install websocket-client. It is a dependency but may be missed in some environments.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'ApiException' from 'ibm_watson'
ApiException is not part of ibm-watson; it is in ibm-cloud-sdk-core.
fix
Use: from ibm_cloud_sdk_core import ApiException
AttributeError: module 'ibm_watson' has no attribute 'SpeechToTextV1'
Possible import of Python file named 'ibm_watson.py' that shadows the package, or using an old import path.
fix
Ensure your script is not named 'ibm_watson.py'. Use: from ibm_watson import SpeechToTextV1
TypeError: createSession() missing 1 required positional argument: 'environment_id'
Assistant V2 session methods now require an 'environmentId' parameter since version 11.0.0.
fix
Call: assistant.create_session(assistant_id='...', environment_id='...')
WatsonApiException: Error: Unauthorized, Code: 401
Invalid API key or the authenticator is not configured correctly.
fix
Verify your API key and ensure you use IAMAuthenticator(api_key). Also check service URL region.
Upgrade
Version history
11.2.0latest on PyPI · released Jan 26, 2026
Audit
Dependencies
requestsrequiredUsed for HTTP API calls
python-dateutilrequiredDate/time handling
websocket-clientrequiredRequired for WebSocket-based services (STT, TTS)
ibm-cloud-sdk-corerequiredCore SDK for authentication and HTTP handling
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
ibm-watson — pip install ibm-watson · libregistry