ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'

Friends, what to do about this error?

I’m getting this error right the beginning of my notebook upon attempting to execute this code:

#hide
! [ -e /content ] && pip install -Uqq fastbook
import fastbook
fastbook.setup_book()

Not sure where you’re coding e.g. Colab / jupyterlab / paperspace,

I tend to do the below in a Kaggle notebook and haven’t had issues.

!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()

I’m using Paperspace.

Fresh cloned fastbook repo from GitHub. Launched Jupiter lab and then launched notebook04 in it and then tried to execute the first pre-populated cell (with the code previously shown).

Getting this error….

Tried copying and pasting your code in the first cell instead, and running it.

Same error….

Could be that you need to upgrade the Pillow module etc. Paperspace image is as of May 2022 so things may have changed in the last 5 months or so.

If you can run the notebook and not get the error for the same cell in Kaggle notebooks or Colab then you can check versions in Colab vs Version in your paperspace instance.

Just a guess.

1 Like

That seems to have worked!

I executed this command in the terminal:

pip install --upgrade pillow

Resulting in this:

Successfully installed pillow-9.2.0

and that seems to have resolved the error! Thank you.

1 Like