allenai / ScienceWorld

ScienceWorld is a text-based virtual environment centered around accomplishing tasks from the standardized elementary science curriculum.
https://sciworld.apps.allenai.org/
Apache License 2.0
199 stars 24 forks source link

Error after run an example command in README - AttributeError: 'ScienceWorldEnv' object has no attribute 'get_task_names' #72

Closed pacozaa closed 2 months ago

pacozaa commented 2 months ago

After run python examples/random_agent.py --task-num=13 --num-episodes=5 --simplifications-preset easy I got

ScienceWorld 1.0 API Examples - Random Agent
Traceback (most recent call last):
  File "examples/random_agent.py", line 213, in <module>
    main()
  File "examples/random_agent.py", line 209, in main
    randomModel(args)
  File "examples/random_agent.py", line 22, in randomModel
    taskNames = env.get_task_names()
AttributeError: 'ScienceWorldEnv' object has no attribute 'get_task_names'
MarcCote commented 2 months ago

Which version of ScienceWorld are you running? If you installed it directly from PyPi, that's most likely an older version.

I just push the new version, i.e. 1.2.0 on PyPi, so you can try reinstalling it.

pacozaa commented 2 months ago

@MarcCote Nice thanks! Let me try.

pacozaa commented 2 months ago

@MarcCote It's working! Thanks. Maybe you can include build from source guide? for next next people.

MarcCote commented 2 months ago

Great. Thanks for the suggestion. I have updated the README.