jiant icon indicating copy to clipboard operation
jiant copied to clipboard

Python 3.6.9 (Colab) doesn't handle circular imports properly

Open zphang opened this issue 5 years ago • 1 comments

We primarily develop against Python 3.7, but Colab uses 3.6.9, which handles circular imports a little differently.

This currently causes problem with our jiant.tasks imports. We run into the following issue with 3.6.9 (as one example)

  1. jiant.tasks: from .retrieval import *
  2. jiant.retrieval:
  • from jiant.tasks.lib.glue_diagnostics import GlueDiagnosticsTask
  • from jiant.tasks.lib.mnli import MnliTask
  1. jiant.tasks.lib.glue_diagnostics: import jiant.tasks.lib.mnli as mnli

This causes Python 3.6.9 to fail to import tasks.

I am pushing a temporary fix to convert all derivative tasks to do a relative import (#150)

  • jiant.tasks.lib.glue_diagnostics
  • jiant.tasks.lib.mnli_mismatched
  • jiant.tasks.lib.superglue_axg
  • jiant.tasks.lib.superglue_axb

while we pursue a longer term solution.

zphang avatar Aug 23 '20 20:08 zphang

Colab has apparently updated to 3.7, so moving forward this should no longer be an issue.

zphang avatar Feb 23 '21 19:02 zphang