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 OPENAI_API_KEY environment variable #152

Open
flowercoder opened this issue Jun 5, 2024 · 1 comment
Open

error OPENAI_API_KEY environment variable #152

flowercoder opened this issue Jun 5, 2024 · 1 comment

Comments

@flowercoder
Copy link

File "E:\oneDrive\GitHub\PycharmProjects\openuiproj.venv\lib\site-packages\openai_client.py", line 316, in init
raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

I try this 3 times.
First,I try python 3.11
finally, I use python 3.10. windows 11
My command as list:

1 pip install openui
2 git clone https://github.com/wandb/openui
3 cd .\openui
4 cd .\backend
5 pip install .
6 set OPENAI_API_KEY={mykey}
7 python -m openui

(.venv) PS E:\oneDrive\GitHub\PycharmProjects\openuiproj\openui\backend> python -m openui Traceback (most recent call last): File "C:\Users\IPAD\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\IPAD\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\oneDrive\GitHub\PycharmProjects\openuiproj\openui\backend\openui\__main__.py", line 3, in <module> from . import server File "E:\oneDrive\GitHub\PycharmProjects\openuiproj\openui\backend\openui\server.py", line 68, in <module> openai = AsyncOpenAI( File "E:\oneDrive\GitHub\PycharmProjects\openuiproj\.venv\lib\site-packages\openai\_client.py", line 316, in __init__ raise OpenAIError( openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

@vanpelt
Copy link
Contributor

vanpelt commented Jun 23, 2024

This might be fixed in the latest release. Not sure what that wasn't working before. There's also a new preferred method of running OpenUI in the readme.

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