ardha27 / AI-Waifu-Vtuber

AI Vtuber for Streaming on Youtube/Twitch
790 stars 125 forks source link

ERROR : NameError when trying to run OpenAI's key #97

Open whybruhcodes281 opened 5 months ago

whybruhcodes281 commented 5 months ago

This problem occurs when trying to run the "run.py". Tried to run it with VSCode and the normal Terminal. I have created the config.py file and input it like this

api_key = sk-myapikeywhichcontainsrandomletters

Tried to run the run.py, but got this error :

Traceback (most recent call last): File "c:\Users\whybruh\Documents\AI-Waifu-Vtuber-master\run.py", line 14, in <module> from config import * File "c:\Users\whybruh\Documents\AI-Waifu-Vtuber-master\config.py", line 4, in <module> api_key = sk-myapikeywhichcontainsrandomletters ^^ NameError: name 'sk' is not defined

Then, tried to add Try-Except for resolving the problem like this :

try: api_key = sk-myapikeywhichcontainsrandomletters except NameError: api_key = sk-myapikeywhichcontainsrandomletters

still, the same error occurred.

What's the solution to this problem? are there any settings to apply in the IDE I'm using?

Vatsal-Shah02 commented 3 months ago

put quotation marks around your key: api_key = 'sk-myapikeywhichcontainsrandomletters' This should do the work.