Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
whybruhcodes281 opened this issue Apr 21, 2024 · 1 comment
Open

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

whybruhcodes281 opened this issue Apr 21, 2024 · 1 comment

Comments

@whybruhcodes281
Copy link

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
Copy link

Vatsal-Shah02 commented Jun 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants