Closed brunsonator3 closed 1 year ago
Either set it like this;
os.environ['OPENAI_API_KEY'] = 'xxxxxxxxxxxxxx'
or edit the env file as per the instructions:
Rename .env.template to .env and fill in your OPENAI_API_KEY
Either set it like this;
Set the API key
os.environ['OPENAI_API_KEY'] = 'xxxxxxxxxxxxxx'
or edit the env file as per the instructions:
Rename .env.template to .env and fill in your OPENAI_API_KEY
Do I keep the ' ?
Either set it like this;
Set the API key
os.environ['OPENAI_API_KEY'] = 'xxxxxxxxxxxxxx'
or edit the env file as per the instructions:
Rename .env.template to .env and fill in your OPENAI_API_KEY
It says "'os.environ['OPENAI_API_KEY']' is not recognized as an internal or external command, operable program or batch file."
Try and edit this instead with notepad++ or similar program;
Rename .env.template to .env and fill in your OPENAI_API_KEY
you need to import os first;
import os
os.environ['OPENAI_API_KEY'] = 'xxxxxxxxxxxxxx'
I'm on Windows CMD.
'import' is not recognized as an internal or external command, operable program or batch file.
I'd Download Visual Code or Pycharm, its less messing about
otherwise you need to search in your settings for environment variables and add into there.
I'd Download Visual Code or Pycharm, its less messing about
otherwise you need to search in your settings for environment variables and add into there.
I'm working in .env now
Is it working for you now? I'd suggest putting it in an .env file, fwiw. The changes you make there will be respected by git if/when you update the code from here later since it's in the .gitignore file.
Where do I paste the API Key? Do I just paste it in the CMD: C:\Users\user\Auto-GPT> sk-randomunits?
Or do I need to do something else? I'm also using windows.
Please open the .env file with a text editor and replace your-openai-api-key with your new OpenAi API KEY
OPENAI_API_KEY=your-openai-api-key
Save/overwrite the file
Give us feeback!
Where do I paste the API Key? Do I just paste it in the CMD: C:\Users\user\Auto-GPT> sk-randomunits? Or do I need to do something else? I'm also using windows.
Please open the .env file with a text editor and replace your-openai-api-key with your new OpenAi API KEY
OPENAI_API_KEY=your-openai-api-key
Save/overwrite the file
Give us feeback!
You need to add to you environment variables if using CMD;
I think you can do it like this;
setx OPENAI_API_KEY "type your key here"
Hey so I figured it out. I had to edit the keys in the .env file using notepad++ and typing in the api keys. Then typing in the CMD: python scripts/main.py
Then install pips as necessary.
Thank you all.
Does anyone know how to find/edit the .env file on a mac? Or rename it through the terminal?
Does anyone know how to find/edit the .env file on a mac? Or rename it through the terminal?
you can use vi editor https://www.oreilly.com/library/view/mac-os-x/0596004583/ch04s02.html#:~:text=vi%20mode%20has%20two%20submodes,keystrokes%20available%20in%20vi%20mode. or TextEdit to create .env file
put following code inside autogpt/main.py
import os
os.environ['OPENAI_API_KEY'] = '
replace
Where do I paste the API Key? Do I just paste it in the CMD: C:\Users\user\Auto-GPT> sk-randomunits?
Or do I need to do something else? I'm also using windows.![number 4 Screenshot 2023-04-04 231605](https://user-images.githubusercontent.com/115924424/230024432-b3d46dc4-b336-4c75-82e9-70324021dbb5.png)