Resolving LlamaIndex and Phoenix Package Conflicts
Hi -- I'm slowly upgrading my code to LlamaIndex 0.10, and upgraded Phoenix to 3.0.3 and openinference-instrumentation-llama-index==1.0.0. However, I get conflicting demands on the packages to install: OpenAIInstrumentor().instrument() import llama_index.core.callbacks, llama_index.core.callbacks.base_handler from llama_index.core.callbacks.base_handler import BaseCallbackHandler from phoenix.trace.llama_index import OpenInferenceTraceCallbackHandler callback_handler = OpenInferenceTraceCallbackHandler() set_global_handler("arize_phoenix") llama_index.set_global_handler("arize_phoenix") ---------------------------------------------------------------------
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
File ~\AppData\Roaming\Python\Python311\site-packages\llama_index\core\callbacks\global_handlers.py:42, in create_global_handler(eval_mode, **eval_params)
41 try:
---> 42 from llama_index.callbacks.arize_phoenix import (
43 arize_phoenix_callback_handler,
44 ) # pants: no-infer-dep
45 except ImportError:
ModuleNotFoundError: No module named 'llama_index.callbacks'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
Cell In[3], line 10
7 # Initialize the callback handler
8 callback_handler = OpenInferenceTraceCallbackHandler()
---> 10 set_global_handler("arize_phoenix")
11 llama_index.set_global_handler("arize_phoenix")
File ~\AppData\Roaming\Python\Python311\site-packages\llama_index\core\callbacks\global_handlers.py:11, in set_global_handler(eval_mode, **eval_params)
8 """Set global eval handlers."""
9 import llama_index.core
---> 11 llama_index.core.global_handler = create_global_handler(eval_mode, **eval_params)
File ~\AppData\Roaming\Python\Python311\site-packages\llama_index\core\callbacks\global_handlers.py:46, in create_global_handler(eval_mode, **eval_params)
42 from llama_index.callbacks.arize_phoenix import (
43 arize_phoenix_callback_handler,
44 ) # pants: no-infer-dep
45 except ImportError:
---> 46 raise ImportError(
47 "ArizePhoenixCallbackHandler is not installed. "
48 "Please install it using `pip install llama-index-callbacks-arize-phoenix`"
49 )
51 handler = arize_phoenix_callback_handler(**eval_params)
52 elif eval_mode == "honeyhive":
ImportError: ArizePhoenixCallbackHandler is not installed. Please install it using `pip install llama-index-callbacks-arize-phoenix`Installing llama-index-callbacks-arize-phoenix forces my Phoenix version back down to 2.11.1:
Installing collected packages: arize-phoenix
Attempting uninstall: arize-phoenix
Found existing installation: arize-phoenix 3.0.3
Uninstalling arize-phoenix-3.0.3:
Successfully uninstalled arize-phoenix-3.0.3
Successfully installed arize-phoenix-2.11.1Also, from the first exception above (No module named llama_index.callbacks), here's a further Traceback. Is there anything I can do from my side to reference this module properly, or does the change need to be made in Phoenix? ----------------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[8], line 5 2 import llama_index.core.callbacks, llama_index.core.callbacks.base_handler 4 from llama_index.core.callbacks.base_handler import BaseCallbackHandler ----> 5 from phoenix.trace.llama_index import OpenInferenceTraceCallbackHandler 7 # Initialize the callback handler 8 callback_handler = OpenInferenceTraceCallbackHandler() File ~\AppData\Local\anaconda3\envs\test\Lib\site-packages\phoenix\trace\llama_index\__init__.py:1 ----> 1 from .callback import OpenInferenceTraceCallbackHandler 2 from .debug_callback import DebugCallbackHandler 4 __all__ = ["OpenInferenceTraceCallbackHandler", "DebugCallbackHandler"] File ~\AppData\Local\anaconda3\envs\test\Lib\site-packages\phoenix\trace\llama_index\callback.py:33 30 from uuid import uuid4 32 import llama_index ---> 33 from llama_index.callbacks.base_handler import BaseCallbackHandler 34 from llama_index.callbacks.schema import ( 35 TIMESTAMP_FORMAT, 36 CBEvent, 37 CBEventType, 38 EventPayload, 39 ) 40 from llama_index.llms.types import ChatMessage, ChatResponse ModuleNotFoundError: No module named 'llama_index.callbacks'
