Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'etree' is not defined #76

Open
OneFiveChen opened this issue Dec 19, 2018 · 4 comments
Open

NameError: name 'etree' is not defined #76

OneFiveChen opened this issue Dec 19, 2018 · 4 comments

Comments

@OneFiveChen
Copy link

After installation, I test Single Agent Example. It works.
But when I test Multi Agent Example, an error shows

2
{'maze_height': '2'}
Traceback (most recent call last):
  File "multiagentExample.py", line 13, in <module>
    "MarLo-Agent-1"
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/__init__.py", line 96, in make
    join_tokens = env.init(params, dry_run=True)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 628, in init
    self.build_env(self.params)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 646, in build_env
    self.setup_mission_spec(params)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 601, in setup_mission_spec
    mission_xml = self.transform_mission_xml(params, mission_xml)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 577, in transform_mission_xml
    vp = etree.Element(ns + "VideoProducer")
NameError: name 'etree' is not defined

I am sure that two port 10000 and 10001 is open and running Minecraft.
I thought it may need import xml.etree, so I add import xml.etree as etree. And it didn't work.
AttributeError: module 'xml.etree' has no attribute 'Element'

So, how to solve this VideoProducer problem?

@andrekramer
Copy link

andrekramer commented Dec 21, 2018

This was fixed recently in the marLo github repository so you could re-install from that. Please see:

#73

(Changing etree to ElementTree)

@OneFiveChen
Copy link
Author

@andrekramer I tried this before, but it also caused an another problem that

2
{'maze_height': '2'}
Traceback (most recent call last):
  File "multiagentExample.py", line 13, in <module>
    "MarLo-Agent-1"
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/__init__.py", line 96, in make
    join_tokens = env.init(params, dry_run=True)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 628, in init
    self.build_env(self.params)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 646, in build_env
    self.setup_mission_spec(params)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 601, in setup_mission_spec
    mission_xml = self.transform_mission_xml(params, mission_xml)
  File "/home/onefivechen/anaconda3/envs/marlo/lib/python3.6/site-packages/marlo/base_env_builder.py", line 580, in transform_mission_xml
    w.text = str(params.videoResolution[0] if params.videoResolution else '800')
AttributeError: 'NoneType' object has no attribute 'text'

@tanakat01
Copy link

I submitted a pull request to fix this problem (see PR#77).

@MonikaBarget
Copy link

Has anything happened on this front? I am also getting this error when using "etree" although I did import the libraries. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants