The community member is facing an Authorization error when trying to import llama_index.AuthenticationError. The error occurs in the get_embeddings function from the llama_index.embeddings.openai module. The comment suggests that the issue may be related to the OpenAI API key not being set correctly, and recommends setting the openai.api_key directly using the environment variable OPENAI_API_KEY.
I am facing Authorization error when I try to do import llama_index. AuthenticationError Traceback (most recent call last) File ~\AppData\Local\anaconda3\Lib\site-packages\tenacity__init.py:382, in Retrying.call__(self, fn, args, **kwargs) 381 try:--> 382 result = fn(args, kwargs) 383 except BaseException: # noqa: B902File C:\experiments\llama_index\llama_index\embeddings\openai.py:185, in get_embeddings(list_of_text, engine, kwargs) 183 list_of_text = [text.replace("\n", " ") for text in list_of_text] --> 185 data = openai.Embedding.create(input=list_of_text, model=engine, **kwargs).data 186 return [d["embedding"] for d in data]