minerllabs / minerl

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

Issue installing for Macbook M3 (No such file or directory error) #754

Closed laithaustin closed 6 months ago

laithaustin commented 7 months ago

I'm having issues getting the installation for the mineRL package to work. My current conda env has python version 3.8.18. I would appreciate any advice on how to deal with the following error:

Edit: also have java version "1.8.0_391" installed as well

pip install git+https://github.com/minerllabs/minerl
Collecting git+https://github.com/minerllabs/minerl
  Cloning https://github.com/minerllabs/minerl to /private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu
  Running command git clone --filter=blob:none --quiet https://github.com/minerllabs/minerl /private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu
  Resolved https://github.com/minerllabs/minerl to commit 8268ee99329ab45793859050d95352d35274532b
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [177 lines of output]
      Cloning into 'MCP-Reborn'...
      Note: switching to '1.16.5-20210115'.

      You are in 'detached HEAD' state. You can look around, make experimental
      changes and commit them, and you can discard any commits you make in this
      state without impacting any branches by switching back to a branch.

      If you want to create a new branch to retain commits you create, you may
      do so (now or later) by using -c with the switch command. Example:

        git switch -c <new-branch-name>

      Or undo this operation with:

        git switch -

      Turn off this advice by setting config variable advice.detachedHead to false

      HEAD is now at 1e71be5 Update README.md
      > Task :mcp:downloadConfig

      > Task :mcp:setupMCP
      Setting up MCP environment
      Initializing steps
      Executing steps
       > Running 'downloadManifest'
       > Running 'downloadJson'
       > Running 'downloadClient'
       > Running 'downloadServer'
       > Running 'stripClient'
       > Running 'stripServer'
       > Running 'merge'
       > Running 'rename'
       > Running 'mcinject'
       > Running 'listLibraries'
       > Running 'decompile'
       > Running 'inject'
       > Running 'patch'
      MCP environment setup is complete

      > Task :applyPatches
      > Task :downloadMappings
      > Task :srg2mcp
      > Task :extractMapped
      > Task :setup

      BUILD SUCCESSFUL in 36s
      6 actionable tasks: 6 executed

      > Configure project :
      * * * * * * * * * * * * * * * * * * * * * * * *
      These are the repositories after plugins have been applied:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_1187335221 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *
      Repositories after removing proxied repos:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_1187335221 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *

      FAILURE: Build failed with an exception.

      * Where:
      Build file '/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/minerl/MCP-Reborn/build.gradle' line: 369

      * What went wrong:
      A problem occurred evaluating root project 'mcprec'.
      > src/main/resources/schemas.index (No such file or directory)

      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

      * Get more help at https://help.gradle.org

      Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings

      BUILD FAILED in 2s

      > Configure project :
      * * * * * * * * * * * * * * * * * * * * * * * *
      These are the repositories after plugins have been applied:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_-587365264 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *
      Repositories after removing proxied repos:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_-587365264 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *

      FAILURE: Build failed with an exception.

      * Where:
      Build file '/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/minerl/MCP-Reborn/build.gradle' line: 369

      * What went wrong:
      A problem occurred evaluating root project 'mcprec'.
      > src/main/resources/schemas.index (No such file or directory)

      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

      * Get more help at https://help.gradle.org

      Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings

      BUILD FAILED in 529ms

      > Configure project :
      * * * * * * * * * * * * * * * * * * * * * * * *
      These are the repositories after plugins have been applied:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_979019096 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *
      Repositories after removing proxied repos:
       | - MavenRepo -> https://repo.maven.apache.org/maven2/
       | - BintrayJCenter -> https://jcenter.bintray.com/
       | - maven -> https://repo.spongepowered.org/maven/
       | - maven2 -> https://maven.minecraftforge.net/
       | - BUNDELED_979019096 -> downloads to: /Users/laithaustin/.gradle/caches/forge_gradle/bundeled_repo/
       | - maven3 -> https://libraries.minecraft.net/
      * * * * * * * * * * * * * * * * * * * * * * * *

      FAILURE: Build failed with an exception.

      * Where:
      Build file '/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/minerl/MCP-Reborn/build.gradle' line: 369

      * What went wrong:
      A problem occurred evaluating root project 'mcprec'.
      > src/main/resources/schemas.index (No such file or directory)

      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

      * Get more help at https://help.gradle.org

      Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings

      BUILD FAILED in 456ms
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/setup.py", line 214, in <module>
          prep_mcp()
        File "/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/setup.py", line 193, in prep_mcp
          raise e
        File "/private/var/folders/nh/sf9wcbxj669f97knb551kl3h0000gn/T/pip-req-build-pg62mobu/setup.py", line 190, in prep_mcp
          subprocess.check_call('{} downloadAssets'.format(gradlew).split(' '), cwd=workdir)
        File "/Users/laithaustin/miniconda3/envs/minerl/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['./gradlew', 'downloadAssets']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Miffyli commented 6 months ago

Hey, sorry for the late reply. Could you confirm your java versions and paste what commands you were using and on which system? This could be a temporary issue with repos that happens sometimes, although this one does not look like that. Sometimes simply retrying installation with empty caches helps (e.g. some files went missing). Note that cloning the repo and installing there sometimes fails as well; I recommend trying the pip install ... command shown in the Readme.

laithaustin commented 6 months ago
 ~ java -version
openjdk version "1.8.0_402"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_402-b06)
OpenJDK 64-Bit Server VM (Temurin)(build 25.402-b06, mixed mode)

I managed to fix the issue, although I'm not completely sure what the fix was. I followed along the similar install instructions for getting MineDojo to work and found this thread https://github.com/MineDojo/MineDojo/issues/113 that seemed to help. Obviously this seems like a hacky workaround, but I managed to fix my problem personally.

Edit: I also uninstalled and changed the java package that I had on my machine. Before I was using oracle's JDK default install for MacOS and was version 1.8.0_391.