Skip to content

Latest commit

 

History

History
193 lines (153 loc) · 4.83 KB

File metadata and controls

193 lines (153 loc) · 4.83 KB

MineDojo Installation Notes

This document contains the complete steps needed to successfully install MineDojo on Arch Linux (should work on other distros with minor adjustments).

System Requirements

  • Python 3.9-3.10 (tested with 3.10.6)
  • Java 8 (OpenJDK)
  • Git
  • wget

Issues Encountered and Solutions

1. Python Environment Setup

MineDojo requires Python ≥ 3.9. We used Python 3.10.6 as newer versions may have compatibility issues.

# If you have pyenv installed, use Python 3.10.6
/home/lesh/.pyenv/versions/3.10.6/bin/python -m venv env
source env/bin/activate

2. Package Version Issues

Issue: gym==0.21.0 has malformed dependency

The gym 0.21.0 package has a broken dependency specification: opencv-python>=3. (missing version number).

Solution:

  1. Download and extract gym source:
wget https://files.pythonhosted.org/packages/4b/48/920cea66177b865663fde5a9390a59de0ef3b642ad98106ac1d8717d7005/gym-0.21.0.tar.gz
tar -xf gym-0.21.0.tar.gz
  1. Fix the setup.py file:
# Edit gym-0.21.0/setup.py
# Change line 20 from:
#     "other": ["lz4>=3.1.0", "opencv-python>=3."],
# To:
#     "other": ["lz4>=3.1.0", "opencv-python>=3.0"],
  1. Install the fixed gym:
cd gym-0.21.0
pip install .
cd ..
rm -rf gym-0.21.0 gym-0.21.0.tar.gz

Issue: NumPy 2.0 compatibility

MineDojo uses np.unicode_ which was removed in NumPy 2.0.

Solution: Edit /home/lesh/coding/dimensional/dojo/MineDojo/minedojo/sim/spaces.py line 520:

# Change from:
super().__init__(shape, np.unicode_)
# To:
super().__init__(shape, np.str_)

3. System Dependencies

Java 8 Installation

MineDojo requires Java 8 for running Minecraft backend.

# On Arch Linux:
sudo pacman -S jdk8-openjdk --noconfirm

# Set JAVA_HOME (needed for each session):
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export PATH=$JAVA_HOME/bin:$PATH

wget Installation (if not present)

sudo pacman -S wget --noconfirm

4. MixinGradle Dependency Issue

Issue: Build fails with "Could not find com.github.SpongePowered:MixinGradle:dcfaf61"

The JitPack repository no longer hosts this specific version of MixinGradle, causing the Minecraft build to fail.

Solution:

  1. Clone the cached MixinGradle repository:
mkdir -p /home/lesh/coding/dimensional/dojo/MineDojo/libs
cd /home/lesh/coding/dimensional/dojo/MineDojo/libs
git clone https://github.com/verityw/MixinGradle-dcfaf61.git
  1. Edit /home/lesh/coding/dimensional/dojo/MineDojo/minedojo/sim/Malmo/Minecraft/build.gradle:

Add the local repository to the repositories block (around line 16):

maven {
    url 'file:///home/lesh/coding/dimensional/dojo/MineDojo/libs'
}

Change the MixinGradle classpath (around line 22) from:

classpath('com.github.SpongePowered:MixinGradle:dcfaf61'){

To:

classpath('MixinGradle-dcfaf61:MixinGradle:dcfaf61'){

Complete Installation Steps

  1. Clone the repository:
git clone https://github.com/MineDojo/MineDojo && cd MineDojo
  1. Create Python environment:
# Using Python 3.10.6 (adjust path as needed)
/home/lesh/.pyenv/versions/3.10.6/bin/python -m venv env
source env/bin/activate
  1. Install system dependencies:
# On Arch Linux
sudo pacman -S jdk8-openjdk wget --noconfirm
  1. Apply the MixinGradle fix:
# Clone the MixinGradle cache
mkdir -p libs && cd libs
git clone https://github.com/verityw/MixinGradle-dcfaf61.git
cd ..

# Edit build.gradle as described above
  1. Fix NumPy compatibility:
# Edit minedojo/sim/spaces.py line 520 as described above
  1. Install dependencies with pip < 24.1 and setuptools < 65:
pip install 'pip<24.1' 'setuptools<65'
  1. Fix and install gym:
# Download, fix, and install gym as described above
  1. Install MineDojo:
pip install -e .
  1. Validate installation:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export PATH=$JAVA_HOME/bin:$PATH
MINEDOJO_HEADLESS=1 python scripts/validate_install.py

You should see [INFO] Installation Success if everything worked correctly.

Important Notes

  • Always run with MINEDOJO_HEADLESS=1 on headless systems or when running in terminal
  • The first run will take time to compile Java code
  • Make sure to set JAVA_HOME and PATH in each new terminal session
  • The MixinGradle fix is essential - without it, the build will fail every time

Troubleshooting

If you encounter issues:

  1. Check that Java 8 is installed and JAVA_HOME is set correctly
  2. Ensure all file edits were applied correctly
  3. Try clearing gradle cache: rm -rf ~/.gradle/caches/
  4. Check that the MixinGradle-dcfaf61 repository was cloned successfully

Version Summary

  • Python: 3.10.6
  • Java: OpenJDK 8
  • pip: < 24.1
  • setuptools: < 65
  • gym: 0.21.0 (patched)
  • numpy: 2.2.6 (with compatibility fix)