{"record":{"id":"5ea94dd57dbdbd2a","repo":"run-llama/llama_index","slug":"promptlayerhandler-is-not-installed-please-instal","errorCode":null,"errorMessage":"PromptLayerHandler is not installed. Please install it using `pip install llama-index-callbacks-promptlayer`","messagePattern":"PromptLayerHandler is not installed\\. Please install it using `pip install llama-index-callbacks-promptlayer`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/callbacks/global_handlers.py","lineNumber":73,"sourceCode":"        handler = arize_phoenix_callback_handler(**eval_params)\n    elif eval_mode == \"honeyhive\":\n        try:\n            from llama_index.callbacks.honeyhive import (\n                honeyhive_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"HoneyHiveCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-honeyhive`\"\n            )\n        handler = honeyhive_callback_handler(**eval_params)\n    elif eval_mode == \"promptlayer\":\n        try:\n            from llama_index.callbacks.promptlayer import (\n                PromptLayerHandler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"PromptLayerHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-promptlayer`\"\n            )\n        handler = PromptLayerHandler(**eval_params)\n    elif eval_mode == \"deepeval\":\n        try:\n            from llama_index.callbacks.deepeval import (\n                deepeval_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"DeepEvalCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-deepeval`\"\n            )\n        handler = deepeval_callback_handler(**eval_params)\n    elif eval_mode == \"simple\":\n        handler = SimpleLLMHandler(**eval_params)\n    elif eval_mode == \"argilla\":","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/callbacks/global_handlers.py#L55-L91","documentation":"Raised by create_global_handler() when eval_mode is 'promptlayer' but llama-index-callbacks-promptlayer is missing. The PromptLayer callback integration is an optional dependency; selecting its eval mode triggers a lazy import that, on ImportError, is re-raised with this install hint.","triggerScenarios":"create_global_handler('promptlayer', ...) or set_global_handler('promptlayer') without the wheel; `from llama_index.callbacks.promptlayer import PromptLayerHandler` fails inside the try block.","commonSituations":"Adding PromptLayer tracing to an existing llama-index app without adding the new extra; environments built from a partial requirements list that predates the integrations split.","solutions":["pip install llama-index-callbacks-promptlayer","Verify: python -c \"from llama_index.callbacks.promptlayer import PromptLayerHandler\"","Set your PromptLayer API token if you continue with tracing","Remove the promptlayer eval mode if unintended"],"exampleFix":"# before\nset_global_handler('promptlayer')  # ImportError\n\n# after\n# pip install llama-index-callbacks-promptlayer\nset_global_handler('promptlayer')","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('llama_index.callbacks.promptlayer') is None:\n    raise SystemExit('pip install llama-index-callbacks-promptlayer')","typeGuard":null,"tryCatchPattern":"try:\n    handler = create_global_handler('promptlayer')\nexcept ImportError as e:\n    handler = None","preventionTips":["Check optional extras after dependency-cache refreshes in CI","Document which eval modes your app supports and their required wheels"],"tags":["llama-index","callbacks","import-error","optional-dependency","promptlayer"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}