openui icon indicating copy to clipboard operation
openui copied to clipboard

Error executing OpenUI

Open kakachiex2 opened this issue 9 months ago • 12 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>

kakachiex2 avatar May 13 '24 02:05 kakachiex2

I'm also getting something similar on ubuntu

playhousehosting avatar May 13 '24 03:05 playhousehosting

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

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

RyuSeiri avatar May 13 '24 03:05 RyuSeiri

same issue here

riazbapoo avatar May 13 '24 08:05 riazbapoo

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.

jawasch avatar May 13 '24 08:05 jawasch

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.

wmsmigiel avatar May 13 '24 10:05 wmsmigiel

Same issue here (win11 & mac).

Swallow74 avatar May 13 '24 13:05 Swallow74

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>

kakachiex2 avatar May 14 '24 02:05 kakachiex2

Ok fixed by setting OpenAI environment variable

kakachiex2 avatar May 14 '24 02:05 kakachiex2

This error ModuleNotFoundError: No module named 'PIL'

is resolved by installing Pillow package

python -m pip install Pillow

SFARPak avatar May 14 '24 06:05 SFARPak

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

hanpham32 avatar May 14 '24 08:05 hanpham32

@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.

Swallow74 avatar May 14 '24 08:05 Swallow74

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

niktekusho avatar May 14 '24 09:05 niktekusho

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]

vanpelt avatar May 15 '24 14:05 vanpelt

Ok fixed by setting OpenAI environment variable

How to set up in Win10 @kakachiex2

liuqiyu avatar May 28 '24 03:05 liuqiyu