ImportError: To support decoding images, please install 'Pillow'.
CONTRIBUTOR
what's your `pip show Pillow` output
2025-01-09T14:02:31Z
https://github.com/huggingface/datasets/issues/7363#issuecomment-2580277519
https://api.github.com/repos/huggingface/datasets/issues/7363
IC_kwDODunzps6Zy-kP
https://api.github.com/repos/huggingface/datasets/issues/comments/2580277519/reactions
2025-01-09T14:02:31Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2580277519
https://avatars.githubusercontent.com/u/31152346?v=4
https://api.github.com/users/ruidazeng/events{/privacy}
https://api.github.com/users/ruidazeng/followers
https://api.github.com/users/ruidazeng/following{/other_user}
https://api.github.com/users/ruidazeng/gists{/gist_id}
https://github.com/ruidazeng
ruidazeng
MDQ6VXNlcjMxMTUyMzQ2
https://api.github.com/users/ruidazeng/orgs
https://api.github.com/users/ruidazeng/received_events
https://api.github.com/users/ruidazeng/repos
https://api.github.com/users/ruidazeng/starred{/owner}{/repo}
https://api.github.com/users/ruidazeng/subscriptions
User
https://api.github.com/users/ruidazeng
public
NONE
same issue.. my pip show Pillow output as below:

```
Name: pillow
Version: 11.1.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.github.io/
Author: 
Author-email: "Jeffrey A. Clark" <aclark@aclark.net>
License: MIT-CMU
Location: [/opt/homebrew/lib/python3.10/site-packages](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/lib/python3.10/site-packages)
Requires: 
Required-by:
```
2025-01-16T08:53:24Z
https://github.com/huggingface/datasets/issues/7363#issuecomment-2594914480
https://api.github.com/repos/huggingface/datasets/issues/7363
IC_kwDODunzps6aq0Cw
https://api.github.com/repos/huggingface/datasets/issues/comments/2594914480/reactions
2025-01-16T08:54:47Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2594914480
https://avatars.githubusercontent.com/u/30711802?v=4
https://api.github.com/users/chansinhui/events{/privacy}
https://api.github.com/users/chansinhui/followers
https://api.github.com/users/chansinhui/following{/other_user}
https://api.github.com/users/chansinhui/gists{/gist_id}
https://github.com/chansinhui
chansinhui
MDQ6VXNlcjMwNzExODAy
https://api.github.com/users/chansinhui/orgs
https://api.github.com/users/chansinhui/received_events
https://api.github.com/users/chansinhui/repos
https://api.github.com/users/chansinhui/starred{/owner}{/repo}
https://api.github.com/users/chansinhui/subscriptions
User
https://api.github.com/users/chansinhui
public
NONE
I encountered the same problem on Ubuntu system, my pip show Pillow output as below:

```
Name: pillow
Version: 10.4.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org/
Author: 
Author-email: "Jeffrey A. Clark" <[aclark@aclark.net](mailto:aclark@aclark.net)>
License: HPND
Location: /home/shunying/.local/lib/python3.8/site-packages
Requires: 
Required-by: 
```

Well, solved this by specifying the pip version to my conda virtual environment :)
2025-02-07T07:27:13Z
https://github.com/huggingface/datasets/issues/7363#issuecomment-2642128329
https://api.github.com/repos/huggingface/datasets/issues/7363
IC_kwDODunzps6de63J
https://api.github.com/repos/huggingface/datasets/issues/comments/2642128329/reactions
2025-02-07T07:30:33Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2642128329
https://avatars.githubusercontent.com/u/20319434?v=4
https://api.github.com/users/Shunying/events{/privacy}
https://api.github.com/users/Shunying/followers
https://api.github.com/users/Shunying/following{/other_user}
https://api.github.com/users/Shunying/gists{/gist_id}
https://github.com/Shunying
Shunying
MDQ6VXNlcjIwMzE5NDM0
https://api.github.com/users/Shunying/orgs
https://api.github.com/users/Shunying/received_events
https://api.github.com/users/Shunying/repos
https://api.github.com/users/Shunying/starred{/owner}{/repo}
https://api.github.com/users/Shunying/subscriptions
User
https://api.github.com/users/Shunying
public
NONE
I have also encountered this. It's a strange thing that's happening.

Checking the code `datasets` it uses `importlib.util.find_spec("PIL")` to verify if `PIL` is installed. While both `pip show` and `importlib` work correctly, I still got the error.

In my case, restarting and redoing the `datasets` import helped. Seems weird to me.
2025-05-28T14:56:52Z
https://github.com/huggingface/datasets/issues/7363#issuecomment-2916657560
https://api.github.com/repos/huggingface/datasets/issues/7363
IC_kwDODunzps6t2KmY
https://api.github.com/repos/huggingface/datasets/issues/comments/2916657560/reactions
2025-05-28T14:56:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2916657560
https://avatars.githubusercontent.com/u/8571358?v=4
https://api.github.com/users/hkropp/events{/privacy}
https://api.github.com/users/hkropp/followers
https://api.github.com/users/hkropp/following{/other_user}
https://api.github.com/users/hkropp/gists{/gist_id}
https://github.com/hkropp
hkropp
MDQ6VXNlcjg1NzEzNTg=
https://api.github.com/users/hkropp/orgs
https://api.github.com/users/hkropp/received_events
https://api.github.com/users/hkropp/repos
https://api.github.com/users/hkropp/starred{/owner}{/repo}
https://api.github.com/users/hkropp/subscriptions
User
https://api.github.com/users/hkropp
public
### Describe the bug

Following this tutorial locally using a macboko and VSCode: https://huggingface.co/docs/diffusers/en/tutorials/basic_training
This line of code: for i, image in enumerate(dataset[:4]["image"]):
throws: ImportError: To support decoding images, please install 'Pillow'.

Pillow is installed.

### Steps to reproduce the bug

Run the tutorial


### Expected behavior

Images should be rendered

### Environment info

MacBook, VSCode