L2 - Import Error

ImportError Traceback (most recent call last)
Cell In[16], line 2
1 import os
----> 2 from utils import get_openai_api_key
4 openai_api_key = get_openai_api_key()
5 os.environ[“OPENAI_MODEL_NAME”] = ‘gpt-3.5-turbo’

ImportError: cannot import name ‘get_openai_api_key’ from ‘utils’ (C:\Users\flore\utils.py)

Are you running this in your own environment, if so you need an OPENAI key. If not try to reset the kernel, and hopefully you haven’t deleted any of the util files by mistake!

Thanks. I am running on my own environment. I have set an open AI key. Still getting this error.

Hi @Naama_Ben-Oliel_Rone

Follow the comment mentioned by Mubsi in the below link


Thanks! I found the utils.py where you guided me.
The thing is that I try to run things locally and not via the notebook. I use mac Visual Studio Code. How can I make this utils.py available?
Should I update the $PATH somehow? … What do u suggest me doing?

did you download the utils py files and all the necessary files from the instructions mentioned by Mubsi? in your local computer?

:frowning: i didn’t see it. Where can I please find the guidelines? This would be fantastic.

You need to follow the same guidelines mentioned in the above comment by Mubsi.

If you are unable to understand his comments then first download all the files use File==Open options and then download all the files.

Check this another comment which explains you the steps with images for your better understanding.

Let me know if you are still not understanding.


1 Like