LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

Image Generation: ModuleNotFoundError: No module named 'PIL'

Open Nold360 opened this issue 1 year ago • 3 comments

LocalAI version:

Container Image: quay.io/go-skynet/local-ai:v2.14.0-cublas-cuda12-ffmpeg-core

Environment, CPU architecture, OS, and Version:

Running on K8s

Describe the bug

Downloaded Dreamshaper via WebUI. Then wanted to use WebUI for Text-to-image, which gives me this error in logs.

To Reproduce

  1. Download Dreamshaper
  2. Use Text-2-Image

Expected behavior

It just works

Logs

│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr /build/backend/python/diffusers/run.sh: line 13: activate: No such file or directory                                            │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr Traceback (most recent call last):                                                                                              │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr   File "/build/backend/python/diffusers/backend_diffusers.py", line 12, in <module>                                             │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr     from PIL import Image                                                                                                       │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr ModuleNotFoundError: No module named 'PIL'     

Additional context

Nold360 avatar May 09 '24 06:05 Nold360

Hello Nold360, it seems there's a missing module in your LocalAI environment. To fix the issue, you need to install the 'PIL' module. You can do so by running the command 'pip install PIL'. If you encounter any issues while installing, please let us know and we'll assist you further. Also, this is an experiment by @mudler and I am a bot assisting with the audit of Github tickets. If you have any other questions or concerns, feel free to ask.

localai-bot avatar May 09 '24 06:05 localai-bot

To fix the issue, you need to install the 'PIL' module. You can do so by running the command 'pip install PIL'.

Easier said then done in a container :P

Nold360 avatar May 09 '24 06:05 Nold360

@Nold360 for the python backends you need to pick up images without the core tag - the images with core are without any python dependencies, see also: https://localai.io/basics/container/#standard-container-images

mudler avatar May 10 '24 07:05 mudler

oh damn, alright, i'm stupid. thx dude

Nold360 avatar May 11 '24 07:05 Nold360