Skip to content

Unable to import textworld in colab #320

@rfy1004

Description

@rfy1004

Hi, I'm running the notebook 'Building a simple agent' in colab and have encountered the following ImportError when I tried to import textworld.

/usr/local/lib/python3.10/dist-packages/tatsu/grammars.py in
4 import os
5 import functools
----> 6 from collections import defaultdict, Mapping
7 from copy import copy
8 from itertools import takewhile

ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)

I tried replacing 'from collections import Mapping' with 'from collections.ac import Mapping' and got this error instead:

/usr/local/lib/python3.10/dist-packages/textworld/envs/wrappers/tw_inform7.py in
91
92
---> 93 class TWInform7(textworld.core.Wrapper):
94 """
95 Wrapper to play Inform7 games generated by TextWorld.

AttributeError: partially initialized module 'textworld' has no attribute 'core' (most likely due to a circular import)

The installation of textworld was sucessfull.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions