This document contains the complete steps needed to successfully install MineDojo on Arch Linux (should work on other distros with minor adjustments).
- Python 3.9-3.10 (tested with 3.10.6)
- Java 8 (OpenJDK)
- Git
- wget
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/activateThe gym 0.21.0 package has a broken dependency specification: opencv-python>=3. (missing version number).
Solution:
- 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- 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"],- Install the fixed gym:
cd gym-0.21.0
pip install .
cd ..
rm -rf gym-0.21.0 gym-0.21.0.tar.gzMineDojo 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_)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:$PATHsudo pacman -S wget --noconfirmThe JitPack repository no longer hosts this specific version of MixinGradle, causing the Minecraft build to fail.
Solution:
- 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- 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'){- Clone the repository:
git clone https://github.com/MineDojo/MineDojo && cd MineDojo- 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- Install system dependencies:
# On Arch Linux
sudo pacman -S jdk8-openjdk wget --noconfirm- 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- Fix NumPy compatibility:
# Edit minedojo/sim/spaces.py line 520 as described above- Install dependencies with pip < 24.1 and setuptools < 65:
pip install 'pip<24.1' 'setuptools<65'- Fix and install gym:
# Download, fix, and install gym as described above- Install MineDojo:
pip install -e .- Validate installation:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export PATH=$JAVA_HOME/bin:$PATH
MINEDOJO_HEADLESS=1 python scripts/validate_install.pyYou should see [INFO] Installation Success if everything worked correctly.
- Always run with
MINEDOJO_HEADLESS=1on 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
If you encounter issues:
- Check that Java 8 is installed and JAVA_HOME is set correctly
- Ensure all file edits were applied correctly
- Try clearing gradle cache:
rm -rf ~/.gradle/caches/ - Check that the MixinGradle-dcfaf61 repository was cloned successfully
- Python: 3.10.6
- Java: OpenJDK 8
- pip: < 24.1
- setuptools: < 65
- gym: 0.21.0 (patched)
- numpy: 2.2.6 (with compatibility fix)