Attribute error with utils package

I am getting error while using function get_openai_api_key. AttributeError: module ‘utils’ has no attribute ‘get_openai_api_key’. Can someone help in resolving it

Hi @anisha_balani,

Are you trying to run the lab locally ?

Best,
Mubsi

yes

Hi @anisha_balani,

On the platform, the utils loads the API key from the environment, which is hidden from learners for various reasons. One of them being, the particular API key has been generated to run only on the platform.

When you try to run things locally, you don’t have that “environment” from where to read the API key, hence, the error. In order to run things on your local or elsewhere, you need to get your own OpenAI API key.

Best,
Mubsi

1 Like

Noted, Thank you!!

Yes, but how do you call your own OpenAI API key?

Depends on how you want to do it.

The courses use .env files. You can search the internet or ask something like chatgpt how to call openai API key in a Jupiter notebook.