the-full-stack/fsdl-text-recognizer-2022

avoid crash in Colab due to gradio importlib magic

charlesfrye opened this issue · 1 comments

something weird happens when you import gradio -- it appears to be tracking its dependencies, and if you change when/where it gets imported or what components are used, it will sometimes break if the dependencies have changed since the kernel started.

this is a weird bug and im being cagey and vague about it because there's a related very weird fact, which is that gradio has itself as one of its members (!), so the following code runs:

import gradio

assert gradio.gradio == gradio

Resolved by resetting pkg_resources