Closed seannyD closed 6 years ago
That looks weird, because basic.xml does not have AgentObservationsPort
element at all. Can you check the location where gym-minecraft is installed with import gym_minecraft; print(gym_minecraft.__file__)
and then make sure that assets/basic.xml
under that directory does not mention AgentObservationsPort
?
gym-minecraft was installed at /Library/Python/2.7/site-packages/gym_minecraft-0.0.2-py2.7.egg/gym_minecraft/__init__.pyc
, and the assets/basic.xml
file is identical to the one in the repository (no mention of AgentObservationsPort).
Did you use minecraft_py repository version? Recent pull request added opportunity to use different Malmo installation by setting MALMO_XSD_PATH environment variable. Do you have that set and maybe that points to newer version of Malmo than required by basic.xml?
You're right - I was using another version of Malmo because I couldn't get the repository version to work. Here's the problem:
If I set MALMO_XSD_PATH
to ~/Documents/Bristol/Minecraft_Malmo/minecraft-py/minecraft_py/Malmo/Schemas/
, then I get this error:
OSError: [Errno 2] No such file or directory: '/Users/sgroberts/Documents/Bristol/Minecraft_Malmo/minecraft-py/minecraft_py/Malmo/Schemas/Minecraft'
So I set MALMO_XSD_PATH
to ~/Documents/Bristol/Minecraft_Malmo/minecraft-py/minecraft_py/Malmo/
(which has the Minecraft folder), but then I get this error:
RuntimeError: Schema file Mission.xsd not found in folder specified by MALMO_XSD_PATH environment variable: /Users/sgroberts/Documents/Bristol/Minecraft_Malmo/minecraft-py/minecraft_py/Malmo/
I tried running launchClient.sh
from minecraft-py/minecraft_py/Malmo/Minecraft
, but I get this error during runClient
:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
Caused by: java.lang.NullPointerException
at net.minecraft.crash.CrashReportCategory.firstTwoElementsOfStackTraceMatch(Unknown Source) ~[CrashReportCategory.class:?]
at net.minecraft.crash.CrashReport.makeCategoryDepth(Unknown Source) ~[CrashReport.class:?]
at net.minecraft.crash.CrashReport.makeCategory(Unknown Source) ~[CrashReport.class:?]
at net.minecraft.client.Minecraft.run(Unknown Source) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(Unknown Source) ~[Main.class:?]
... 12 more
Either don't set MALMO_XSD_PATH
at all or set it to ~/Documents/Bristol/Minecraft_Malmo/minecraft-py/minecraft_py/Malmo/Schemas
, i.e. without trailing slash. That might be confusing the code.
Alternatively, if you want to keep using your latest Malmo version, set MALMO_XSD_PATH as it was previously and manually load the latest basic.xml.
I'm not really sure about the last Java error. If you are unlucky then two Minecraft installations might have installed conflicting Gradle versions. But I really hope not.
Thanks, I set it without the trailing slash, and now it starts properly, but fails here:
Traceback (most recent call last):
File "Test_Malmo_Gym.py", line 10, in <module>
env.init(start_minecraft=True)
File "/Library/Python/2.7/site-packages/gym_minecraft-0.0.2-py2.7.egg/gym_minecraft/envs/minecraft_env.py", line 114, in init
self.mc_process, port = minecraft_py.start()
File "/Library/Python/2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/minecraft_py/__init__.py", line 76, in start
raise EOFError("Minecraft process finished unexpectedly")
EOFError: Minecraft process finished unexpectedly
I suspect it is something to do with conflicting versions. But the xml problem is fixed, so I suggest you close this issue and I'll try reinstalling everything.
Thanks for your help!
I think this comes down to the NullPointerException above. It will be hard to troubleshoot generic error like this remotely. But your independently installed Malmo version seemed to work fine, you could set MALMO_XSD_PATH back as it was previously and try with latest basic.xml from Malmo repo.
I just installed gym-minecraft and I'm trying to run the first default mission ('MinecraftBasic-v0'), but having problems getting the mission to start. I'm using the
test.py
code:Minecraft starts, but then I get this error:
I haven't changed any of the xml files, and the xml text is structurally valid. I also tried loading the mission file from another source:
The script loaded the mission file correctly, but I still get the same error.
Then there's the other error:
error: element 'AgentObservationsPort' is not allowed for content model
. This seems to be linked to the ClientAgentConnection in Malmo https://github.com/Microsoft/malmo/blob/master/Schemas/MissionInit.xsdAny help would be much appreciated!