WARNING: The following packages were previously imported in this runtime: [PIL] You must restart the runtime in order to use newly installed versions

Viewed 5015

This is a question from an absolute beginner of programing.

I tried the following codes on Google Colaboratory, and received the warning as written on the title of this post.

I restarted the runtime (which I believe worked successfully), but then when I retried the codes (by hitting 'run' button), I got the same warning.

Do you have any suggestion on how to fix this?

Thank you in advance.

!pip install torch torchvision
import torch
print('torch vision: ', torch.__version__)

!pip uninstall -y Pillow
!pip install Pillow==5.3.0
import PIL
print('pillow version: ', PIL.PILLOW_VERSION)
like so
1 Answers

You have to

  • uninstall/install modules
  • restart runtime
  • run code without uninstall/install

But first I would try code with the newest modules - without unistalling/installing.

Your tutorial is almost 1 year old and maybe it needed Pillow 5.3.0 at that momen. But it uses also Torch 0.4.0 and today we have 1.7.0 and it may work correctly with Pillow 7.0.0

Related