{"id":23050,"library":"azure-cognitiveservices-knowledge-qnamaker","title":"Azure QnA Maker Client Library for Python","description":"Microsoft Azure QnA Maker Client Library for Python enables programmatic management of QnA Maker knowledge bases and endpoints. Current version 0.3.1 is stable but in maintenance mode; Azure recommends migrating to the newer question answering service via azure-ai-language-questionanswering. Release cadence is low.","status":"maintenance","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","cognitiveservices","qnamaker","knowledge-base","question-answering"],"install":[{"cmd":"pip install azure-cognitiveservices-knowledge-qnamaker","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for REST client operations","package":"msrest","optional":false},{"reason":"Common Azure SDK utilities","package":"azure-common","optional":false}],"imports":[{"note":"Wrong path: QnAMakerClient is directly under the package, not a submodule.","wrong":"from azure.cognitiveservices.knowledge.qnamaker.qn_amaker_client import QnAMakerClient","symbol":"QnAMakerClient","correct":"from azure.cognitiveservices.knowledge.qnamaker import QnAMakerClient"},{"note":"Runtime client is in a separate 'runtime' subpackage.","wrong":"from azure.cognitiveservices.knowledge.qnamaker import QnAMakerRuntimeClient","symbol":"QnAMakerRuntimeClient","correct":"from azure.cognitiveservices.knowledge.qnamaker.runtime import QnAMakerRuntimeClient"},{"note":"","wrong":null,"symbol":"models","correct":"from azure.cognitiveservices.knowledge.qnamaker import models"}],"quickstart":{"code":"import os\nfrom azure.cognitiveservices.knowledge.qnamaker import QnAMakerClient\nfrom azure.cognitiveservices.knowledge.qnamaker.models import QnADTO\nfrom msrest.authentication import CognitiveServicesCredentials\n\nsubscription_key = os.environ.get('QNAMAKER_SUBSCRIPTION_KEY', '')\nendpoint = os.environ.get('QNAMAKER_ENDPOINT', 'https://<your-resource-name>.cognitiveservices.azure.com')\n\ncredentials = CognitiveServicesCredentials(subscription_key)\nclient = QnAMakerClient(endpoint, credentials)\n\n# List all knowledge bases\nkbs = client.knowledgebase.list()\nfor kb in kbs.knowledgebases:\n    print(kb.name, kb.id)","lang":"python","description":"Authenticate and list QnA Maker knowledge bases."},"warnings":[{"fix":"Migrate to azure-ai-language-questionanswering (pip install azure-ai-language-questionanswering)","message":"QnA Maker service is being retired. Azure recommends using the newer question answering service via the 'azure-ai-language-questionanswering' package.","severity":"deprecated","affected_versions":"all"},{"fix":"Use 'from azure.cognitiveservices.knowledge.qnamaker.runtime import QnAMakerRuntimeClient' for runtime operations.","message":"The runtime client (QnAMakerRuntimeClient) is imported from a different subpackage ('runtime') than the management client.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass 'endpoint' as first argument: QnAMakerClient(endpoint, credentials).","message":"In version 0.3.0, the 'QnAMakerClient' constructor changed: 'endpoint' is now required and the 'base_url' parameter was removed.","severity":"breaking","affected_versions":"0.3.0+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to the latest: pip install --upgrade azure-cognitiveservices-knowledge-qnamaker","cause":"Often caused by incomplete installation or using a very old version (pre-0.2.0).","error":"ImportError: cannot import name 'QnAMakerClient' from 'azure.cognitiveservices.knowledge.qnamaker'"},{"fix":"Use QnAMakerClient (not QnAMakerRuntimeClient) for knowledge base management.","cause":"Using the runtime client instead of the management client. The runtime client does not have knowledgebase operations.","error":"AttributeError: 'QnAMakerClient' object has no attribute 'knowledgebase'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}