PILLOW_VERSION error

when I execute

from torchvision import datasets, transforms

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (/home/kemo/anaconda3/envs/python10/lib/python3.10/site-packages/PIL/__init__.py)

I tried to downgrade PILLow_VERSION with conda into 6.2.1 but in vain, nothing happened!
any help?
I think this error happens after updating conda env.

I solved it with the following code

conda install pytorch torchvision -c pytorch

I don’t know what is the difference with this code and

conda update --all