Log in
Log into community
Find answers from the community
View all posts
Related posts
Was this helpful?
π
π
π
Powered by
Hall
Inactive
Updated 5 months ago
0
Follow
Openai key
Openai key
Inactive
0
Follow
At a glance
r
rmntlns
2 years ago
Β·
Is anyone else getting the "Did not find openai_api_key" error in Colab when running:
documents = SimpleDirectoryReader('data').load_data()
index = GPTSimpleVectorIndex.from_documents(documents)
L
r
3 comments
Share
Open in Discord
L
Logan M
2 years ago
Did you set the key in collab?
Plain Text
Copy
import os os.environ["OPENAI_API_KEY"] = "key"
r
rmntlns
2 years ago
Thanks, I set the OPENAI_API_KEY = "key" directly. Appreciate the quick response.
L
Logan M
2 years ago
If you set it that way in colab, I think it needs to be an export
!export OPENAI_API_KEY="key"
That or the os method should work
Add a reply
Sign up and join the conversation on Discord
Join on Discord