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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.924s · 29.1MB
glibcpy 3.10–3.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)
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.
fixUse: 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.
fixEnsure 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.
fixCall: assistant.create_session(assistant_id='...', environment_id='...')
WatsonApiException: Error: Unauthorized, Code: 401
Invalid API key or the authenticator is not configured correctly.
fixVerify 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