stable-diffusion-deploy icon indicating copy to clipboard operation
stable-diffusion-deploy copied to clipboard

Cannot import name 'Image' from 'PIL' (unknown location)

Open slavakurilyak opened this issue 1 year ago • 2 comments

🐛 Bug

I am trying to create a Lightning BYOC cluster

To Reproduce

Steps to reproduce the behavior:

  1. Run lightning create cluster <cluster-name> --role-arn <ARN> --external-id <EXTERNAL-ID>

Traceback (most recent call last):

  File "/usr/local/bin/lightning", line 5, in <module>
    from lightning.app.cli.lightning_cli import main
  File "/usr/local/lib/python3.9/site-packages/lightning/__init__.py", line 32, in <module>
    from lightning.app import storage  # noqa: E402
  File "/usr/local/lib/python3.9/site-packages/lightning/app/__init__.py", line 25, in <module>
    from lightning.app import components  # noqa: E402, F401
  File "/usr/local/lib/python3.9/site-packages/lightning/app/components/__init__.py", line 15, in <module>
    from lightning.app.components.serve.serve import ModelInferenceAPI
  File "/usr/local/lib/python3.9/site-packages/lightning/app/components/serve/serve.py", line 28, in <module>
    from lightning.app.components.serve.types import _DESERIALIZER, _SERIALIZER
  File "/usr/local/lib/python3.9/site-packages/lightning/app/components/serve/types/__init__.py", line 1, in <module>
    from lightning.app.components.serve.types.image import Image
  File "/usr/local/lib/python3.9/site-packages/lightning/app/components/serve/types/image.py", line 25, in <module>
    from PIL import Image as PILImage
ImportError: cannot import name 'Image' from 'PIL' (unknown location)

Code sample

Expected behavior

I'm expecting the command to work.

Environment

  • PyTorch Version (e.g., 1.0):
  • OS (e.g., Linux): macOS
  • How you installed PyTorch (conda, pip, source): virtualenv
  • Build command you used (if compiling from source):
  • Python version: 3.9
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

I tried the following without success:

pip uninstall Pillow
pip install Pillow

I also tried:

pip install Pillow==8.3.1

slavakurilyak avatar Feb 22 '23 08:02 slavakurilyak