{"id":23870,"library":"ibm-watson","title":"IBM Watson Python SDK","description":"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.","status":"active","version":"11.2.0","language":"python","source_language":"en","source_url":"https://github.com/watson-developer-cloud/python-sdk","tags":["ibm","watson","speech-to-text","text-to-speech","assistant","natural-language-understanding","discovery","sdk"],"install":[{"cmd":"pip install ibm-watson","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install ibm-watson==11.2.0","lang":"bash","label":"Install specific version"}],"dependencies":[{"reason":"Used for HTTP API calls","package":"requests","optional":false},{"reason":"Date/time handling","package":"python-dateutil","optional":false},{"reason":"Required for WebSocket-based services (STT, TTS)","package":"websocket-client","optional":false},{"reason":"Core SDK for authentication and HTTP handling","package":"ibm-cloud-sdk-core","optional":false}],"imports":[{"note":"The old package name 'watson_developer_cloud' is deprecated. Use 'ibm_watson'.","wrong":"from watson_developer_cloud import SpeechToTextV1","symbol":"SpeechToTextV1","correct":"from ibm_watson import SpeechToTextV1"},{"note":"Direct import from ibm_watson is correct; the submodule path is outdated.","wrong":"from ibm_watson.assistant_v2 import AssistantV2","symbol":"AssistantV2","correct":"from ibm_watson import AssistantV2"},{"note":"Use top-level import from ibm_watson.","wrong":"from ibm_watson.text_to_speech import TextToSpeechV1","symbol":"TextToSpeechV1","correct":"from ibm_watson import TextToSpeechV1"},{"note":"Top-level import is preferred.","wrong":"from ibm_watson.natural_language_understanding import NaturalLanguageUnderstandingV1","symbol":"NaturalLanguageUnderstandingV1","correct":"from ibm_watson import NaturalLanguageUnderstandingV1"},{"note":"ApiException lives in ibm_cloud_sdk_core, not ibm_watson.","wrong":"from ibm_watson import ApiException","symbol":"ApiException","correct":"from ibm_cloud_sdk_core import ApiException"}],"quickstart":{"code":"from ibm_watson import SpeechToTextV1\nfrom ibm_cloud_sdk_core.authenticators import IAMAuthenticator\n\nauthenticator = IAMAuthenticator('your-api-key')\nstt = SpeechToTextV1(authenticator=authenticator)\nstt.set_service_url('https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/your-instance-id')\n\n# Example: transcribe an audio file\nwith open('audio.wav', 'rb') as audio_file:\n    result = stt.recognize(audio=audio_file, content_type='audio/wav').get_result()\nprint(result)","lang":"python","description":"Initialize Speech to Text service with IAM authentication and transcribe an audio file."},"warnings":[{"fix":"Add the 'environmentId' argument when calling create_session() or delete_session().","message":"Version 11.0.0+ requires 'environmentId' parameter in Assistant V2 'createSession' and 'deleteSession' methods.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Remove these parameters from your recognize_with_websocket() calls.","message":"Version 10.0.0 removed 'interim_results' and 'low_latency' WebSocket parameters from Speech to Text.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Update Discovery V2 code to use the new batches APIs (e.g., list_batches, get_batch).","message":"Version 9.0.0 introduced breaking changes in Discovery V2 batch API endpoints.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Use 'from ibm_watson import ...' instead.","message":"Old import paths like 'from watson_developer_cloud import ...' are deprecated and removed in recent versions.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Install websocket-client: pip install websocket-client. It is a dependency but may be missed in some environments.","message":"Speech to Text WebSocket streaming requires the 'websocket-client' package to be installed separately.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from ibm_cloud_sdk_core import ApiException","cause":"ApiException is not part of ibm-watson; it is in ibm-cloud-sdk-core.","error":"ImportError: cannot import name 'ApiException' from 'ibm_watson'"},{"fix":"Ensure your script is not named 'ibm_watson.py'. Use: from ibm_watson import SpeechToTextV1","cause":"Possible import of Python file named 'ibm_watson.py' that shadows the package, or using an old import path.","error":"AttributeError: module 'ibm_watson' has no attribute 'SpeechToTextV1'"},{"fix":"Call: assistant.create_session(assistant_id='...', environment_id='...')","cause":"Assistant V2 session methods now require an 'environmentId' parameter since version 11.0.0.","error":"TypeError: createSession() missing 1 required positional argument: 'environment_id'"},{"fix":"Verify your API key and ensure you use IAMAuthenticator(api_key). Also check service URL region.","cause":"Invalid API key or the authenticator is not configured correctly.","error":"WatsonApiException: Error: Unauthorized, Code: 401"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}