tambetm / gym-minecraft

Minecraft environment for Open AI Gym, based on Microsoft's Malmo.
272 stars 29 forks source link

Error while setting up #11

Open mariomeissner opened 7 years ago

mariomeissner commented 7 years ago

Hello there! I tried installing following the instructions.

pip install gym
minecraft_py: git clone and python setup.py install
pip install pygame
gym_minecraft: git clone and python setup.py install

Up to this point no problem encountered. However now I try to run the provided snippet for building Minecraft:

    import logging
    logging.basicConfig(level=logging.DEBUG)
    import minecraft_py
    proc, port = minecraft_py.start()
    minecraft_py.stop(proc)

And the line minecraft_py.start() throws an error:

python snippet.py 
INFO:minecraft_py:Starting Minecraft process: /home/mario/miniconda3/envs/pygym2/lib/python2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/minecraft_py/Malmo/Minecraft/launchClient.sh -port 10000
Traceback (most recent call last):
  File "snippet.py", line 6, in <module>
    proc, port = minecraft_py.start()
  File "/home/mario/miniconda3/envs/pygym2/lib/python2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/minecraft_py/__init__.py", line 64, in start
    preexec_fn=os.setsid)
  File "/home/mario/miniconda3/envs/pygym2/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/home/mario/miniconda3/envs/pygym2/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory: '/home/mario/miniconda3/envs/pygym2/lib/python2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/minecraft_py/Malmo/Minecraft'

It seems that the path to Malmo is wrong.

I would also like to mention that I have a separate Malmo installation going on in a different folder, I hope that is not interfering here.

Performing: ls /home/mario/miniconda3/envs/pygym2/lib/python2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/minecraft_py/ reveals that there is no Malmo there, as there are only two files inside: __init__.py __init__.pyc

I can confirm that minecraft_py is listed by conda list as a successfully installed package, version 0.0.2

Sorry in advance if this issue is trivial or I'm doing something obvious wrong.

tambetm commented 7 years ago

It seems that minecraft_py failed to download Malmo zip in setup.py. If you can, you could use precompiled version for Ubuntu, either https://github.com/tambetm/minecraft-py34-ubuntu1404 or https://github.com/tambetm/minecraft-py35-ubuntu1604.

Otherwise you would need to debug setup.py for minecraft_py, improvements to error handling would be very welcome!

DeastinY commented 7 years ago

I stumbled upon the same issues and downloaded Malmo from here https://github.com/Microsoft/malmo/releases copied it to minecraft-py/Malmo and removed all the downloading code from setup.py.
For me the issue was that I'm on Ubuntu 17.04 for which there is no download available.