stable-diffusion-deploy
stable-diffusion-deploy copied to clipboard
Cannot import name 'Image' from 'PIL' (unknown location)
🐛 Bug
I am trying to create a Lightning BYOC cluster
To Reproduce
Steps to reproduce the behavior:
- 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
It looks like your environment is broken or has some inconsistencies. Could you try installing lightning in a new environment (you don't need to install Pillow explicitly - just pip install -U lightning
would do) and try again?
@hhsecond same issue. I tried pip
, conda
, virtualenv
, and virtualenvwrapper
. I also tried pip install -U lightning
but the issue persists. Could this be a dependency issue, examplePIL
? Pillow
was a PIL
fork.