---
title: "law (@law907) | Hashnode"
description: "law (@law907) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@law907"
---

@law907

# law

@law907 · Joined August 2023

## Comments

[Hi That is nicely written guides. I have a question: For below codes; from llama\_index import VectorStoreIndex, SimpleDirectoryReader #Load documents from a directory documents = SimpleDirectoryReader('book').load\_data() #Create an index from the documents index=VectorStoreIndex.from\_documents(documents) i have an exception thrown at this line:VectorStoreIndex.from\_documents(..) No API key found for OpenAI. Please set either the OPENAI\_API\_KEY environment variable or openai.api\_key prior to initialization. API keys can be found or created at ..... I am just testing the indexing, and i am not using openai. Why was there an openai exception when the app is executing this line: VectorStoreIndex.from\_documents(documents)?](https://hashnode.com/posts/mastering-llamaindex-create-save-load-indexes-customize-llms-prompts-embeddings/64a560e87d111a4ae1f7f572/comment/64ca4fae218e67b3098f524f)

Comment · Article · Aug 2, 2023 · [Mastering LlamaIndex : Create, Save & Load Indexes, Customize LLMs, Prompts & Embeddings](https://hashnode.com/posts/mastering-llamaindex-create-save-load-indexes-customize-llms-prompts-embeddings/64a560e87d111a4ae1f7f572)
