wandb / openui

OpenUI let's you describe UI using your imagination, then see it rendered live.

Home Page:https://openui.fly.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error executing OpenUI

kakachiex2 opened this issue · comments

I'm getting this error on windows

(OpenUI) PS C:\OpenUI\openui\backend> python -m openui
Traceback (most recent call last):
File "C:\Users\rafae\miniconda3\envs\OpenUI\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\rafae\miniconda3\envs\OpenUI\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\OpenUI\openui\backend\openui_main
.py", line 3, in
from . import server
File "C:\OpenUI\openui\backend\openui\server.py", line 35, in
from .util import storage
File "C:\OpenUI\openui\backend\openui\util_init
.py", line 1, in
from .screenshots import gen_screenshots
File "C:\OpenUI\openui\backend\openui\util\screenshots.py", line 3, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
(OpenUI) PS C:\OpenUI\openui\backend>

I'm also getting something similar on ubuntu

(docker) i'm get same error on macos:

image:
スクリーンショット 2024-05-13 12 55 51

same issue here

I traced the Issue back to not installed playwright and pillow packages.
In the file openui/backend/pyproject.toml these two packages are mentioned inside
[project.optional-dependencies] test = ["pytest", "pre-commit"] eval = [ "Pillow>=8.3.1", "playwright>=1.41.0", "beautifulsoup4>=4.0.0", "mistletoe>=1.0.0", ]
After i have replaced them at
[project] dependencies = [ "weave@git+https://github.com/wandb/weave.git@fix/tiktoken-images", "openai>=1.12.0", "ollama>=0.1.7", "itsdangerous>=2.0.1", "peewee>=3.0.0", "fastapi>=0.108.0", "uvicorn>=0.25.0", "fastapi-sso>=0.13.0", "boto3>=1.34.67", "Pillow>=8.3.1", "playwright>=1.41.0", ]
for me the Container is starting and running.

I traced the Issue back to not installed playwright and pillow packages. In the file openui/backend/openui/pyproject.toml these two packages are mentioned inside [project.optional-dependencies] test = ["pytest", "pre-commit"] eval = [ "Pillow>=8.3.1", "playwright>=1.41.0", "beautifulsoup4>=4.0.0", "mistletoe>=1.0.0", ] After i have replaced them at [project] dependencies = [ "weave@git+https://github.com/wandb/weave.git@fix/tiktoken-images", "openai>=1.12.0", "ollama>=0.1.7", "itsdangerous>=2.0.1", "peewee>=3.0.0", "fastapi>=0.108.0", "uvicorn>=0.25.0", "fastapi-sso>=0.13.0", "boto3>=1.34.67", "Pillow>=8.3.1", "playwright>=1.41.0", ] for me the Container is starting and running.

I had the same issue, adding pillow and playwright fixed it for me, Thanks!

one comment - the location of the pyproject.toml is in backend/pyproject.toml for me.

Same issue here (win11 & mac).

after install playwright and pillow I'm getting this error:
Loading personal and system profiles took 679ms.
(base) PS C:\OpenUI\openui\backend> python -m openui
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\OpenUI\openui\backend\openui_main
.py", line 3, in
from . import server
File "C:\OpenUI\openui\backend\openui\server.py", line 68, in
openai = AsyncOpenAI(
^^^^^^^^^^^^
File "C:\Users\rafae\miniconda3\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
(base) PS C:\OpenUI\openui\backend>

Ok fixed by setting OpenAI environment variable

This error
ModuleNotFoundError: No module named 'PIL'

is resolved by installing Pillow package

python -m pip install Pillow

commented

@Swallow74 could you please provide the error message you received?

@Swallow74 could you please provide the error message you received?

I am really dumb, sorry... I was running OpenUI with Pinokio, and I didn't realize that this launcher uses its own conda environment, and so I had to install Pillow inside this env. Sorry again for reporting a problem related to external code.

This is the traceback of commands I run to make openui work for me on macOs (using a local llava instance):

cd backend
python -m pip install Pillow playwright
OPENAI_API_KEY='' python -m openui

crap, sorry everyone. I just fixed this in the main branch, Pillow and playwright are no longer pulled in by default. We only use them if you're doing evaluations of different prompts / models, more to come there.

If anyone get's this now another quick fix would be to run the following from within the backend directory:

pip install .[eval]

Ok fixed by setting OpenAI environment variable

How to set up in Win10 @kakachiex2