minerllabs / minerl

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package
http://minerl.io/docs/
Other
709 stars 153 forks source link

Installation error on windows 11 using WSL 2 #776

Open danny-weiss opened 5 months ago

danny-weiss commented 5 months ago

I've been trying to install this but keep getting this error log:

  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.

  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.

  ERROR: JAVA_HOME is set to an invalid directory: /mnt/c/Program Files/Java/jdk-1.8

  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 222, in <module>
      prep_mcp()
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 201, in prep_mcp
      raise e
    File "/tmp/pip-req-build-gysc0w83/setup.py", line 198, in prep_mcp
      subprocess.check_call('{} downloadAssets'.format(gradlew).split(' '), cwd=workdir)
    File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['./gradlew', 'downloadAssets']' returned non-zero exit status 1.
  [end of output]

I think my java is set up wrong but when I do java -version on my WSL and command line I get 1.8.x, I set up the java_home variable with these commands: setx JAVA_HOME "C:\Program Files\Java\jdk-1.8" setx WSLENV "JAVA_HOME/p"

And it seems to be pointing to the right file, but the program can't recognize it as a java file maybe?

Miffyli commented 5 months ago

Hey. I think the paths should point to C:\Program Files\Java\jdk-1.8\bin. Also, you should usually have to set these paths, as they are usually set while installing. You know things work when java and javac commands work.

danny-weiss commented 5 months ago

I tried setting the JAVA_HOME path to C:\Program Files\Java\jdk-1.8\bin but it unfortunately didn't work. But also, I discovered that when I set the JAVA_HOME variable to C:Program Files, java -version still works and returns java 1.8 I think it's not the JAVA_HOME variable that makes java work but a path variable to C:Program Files\Common Files\Oracle\Java\Javapath

Miffyli commented 4 months ago

@danny-weiss I unfortunately do not have much concrete tips to give here. But I do know that you should have java and javac commands available anywhere in the system (and also in the WSL, since you are on Windows) to be able to install. I would personally just reinstall things if env variables were screwed up like that 😅

danny-weiss commented 4 months ago

I've tried uninstalling and reinstalling the WSL but it didn't really work, is there an alternative bash command line I can use?

Miffyli commented 4 months ago

@danny-weiss Unfortunately I do not have any additional tips to give here. There was a more hacky approach to do this installation by using mingw (installing it, pointing to the right bash.exe, etc), but that has been finnicky to setup and not highly recommended.

The main thing you need is the bash and the commands used by this script.