Installation Guide - macOS
This guide will walk you through setting up MLVisual on macOS step by step.
๐ Prerequisitesโ
- macOS 10.15 (Catalina) or higher
- 8GB RAM minimum (16GB recommended)
- 10GB free disk space
- Internet connection
- Terminal (native macOS application)
๐ Step-by-Step Installationโ
1. Install Homebrew (Package Manager)โ
Install Homebrewโ
Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Verify Installationโ
brew --version
2. Install Unity 2022.3 LTSโ
Download Unity Hubโ
- Go to unity.com/download
- Download Unity Hub for macOS
- Drag Unity Hub to the Applications folder
- Open Unity Hub from Applications
Install Unity Editorโ
- Open Unity Hub
- Go to the "Installs" tab
- Click "Install Editor"
- Select Unity 2022.3.XX LTS (the latest version)
- In "Add Modules", select:
- โ Xcode (for iOS development)
- โ WebGL Build Support (for web demos)
- โ Android Build Support (optional)
- Click "Install" and wait for it to finish
3. Install Python 3.8+โ
Install Python using Homebrewโ
# Install Python
brew install python@3.9
# Verify installation
python3 --version
pip3 --version
Configure Alias (Optional)โ
To use python instead of python3:
# Add to your shell profile
echo 'alias python=python3' >> ~/.zshrc
echo 'alias pip=pip3' >> ~/.zshrc
# Reload configuration
source ~/.zshrc
4. Set Up Virtual Environmentโ
Create the Environmentโ
# Navigate to your projects directory
cd ~/Documents
# Create directory if it doesn't exist
mkdir -p mlvisual-projects
cd mlvisual-projects
# Create virtual environment
python3 -m venv mlvisual-env
# Activate the environment
source mlvisual-env/bin/activate
Verify it Worksโ
# You should see (mlvisual-env) at the beginning of your prompt
which python
# Should point to your virtual environment
5. Install mlvlabโ
# Make sure your virtual environment is active
# You should see (mlvisual-env) in your prompt
# Update pip
python -m pip install --upgrade pip
# Install mlvlab
pip install mlvlab
# Verify installation
python -c "import mlvlab; print('mlvlab installed correctly')"
6. Install Additional Dependenciesโ
# Essential libraries for RL
pip install numpy pandas matplotlib seaborn
pip install gymnasium stable-baselines3
pip install jupyter notebook
# For visualization and debugging
pip install tensorboard wandb
# For development
pip install black flake8 pytest
# System dependencies for matplotlib
brew install freetype
7. Configure Unity for mlvlabโ
Install the mlvlab Packageโ
- Open Unity Hub
- Create a new 3D project
- Go to Window > Package Manager
- Click the "+" in the top left corner
- Select "Add package from git URL"
- Enter:
https://github.com/mlvisual/mlvlab-unity.git - Click "Add"
Verify Installationโ
- In Unity, go to Assets > Create > mlvlab
- You should see options like "Test Environment"
- If there are no errors, everything is working!
โ Complete Verificationโ
Python Testโ
Create a file test_installation.py:
import mlvlab
import numpy as np
import matplotlib.pyplot as plt
import gymnasium as gym
print("โ
mlvlab imported correctly")
print("โ
numpy working")
print("โ
matplotlib working")
print("โ
gymnasium working")
print("โ
Installation complete!")
Unity Testโ
- Open Unity Hub
- Create a new 3D project
- Go to Assets > Create > mlvlab > Test Environment
- If there are no errors, everything is working!
๐ง macOS-Specific Troubleshootingโ
Error: "command not found: python"โ
Cause: Python not in PATH Solution:
# Verify Python is installed
which python3
# If not, install it
brew install python@3.9
# Verify version
python3 --version
Error: "command not found: pip"โ
Solution:
# Install pip if not present
brew install python@3.9
# Or use python3 -m pip
python3 -m pip install --upgrade pip
Error: "mlvlab not found"โ
Cause: Virtual environment not activated Solution:
# Navigate to your project directory
cd ~/Documents/mlvisual-projects
# Activate the environment
source mlvisual-env/bin/activate
# Verify it's active (you should see (mlvisual-env))
pip list
Unity can't find mlvlabโ
Solution:
- Verify the package is installed in Package Manager
- Restart Unity
- Verify you're using Unity 2022.3 LTS
Permission errors on macOSโ
Solution:
# Change directory permissions
sudo chown -R $USER:staff ~/mlvisual-projects
# Or use sudo if necessary
sudo pip install mlvlab
matplotlib issues on macOSโ
Solution:
# Install system dependencies
brew install freetype libpng
# Reinstall matplotlib
pip uninstall matplotlib
pip install matplotlib
Homebrew installation issuesโ
Solution:
# Update Homebrew
brew update
# Fix permissions
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
# Reinstall Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Xcode command line tools missingโ
Solution:
# Install Xcode command line tools
xcode-select --install
# Verify installation
xcode-select -p
๐ Ready to Get Started!โ
Now you have everything set up on macOS. You can:
- Explore the Glossary to understand the terms
- Read the Theoretical Articles to dive deeper into theory
- Start with the Laboratories to practice
๐ Need Help?โ
If you encounter any macOS-specific issues:
- Check the Troubleshooting section above
- Search our Glossary to understand terms
- Consult the Articles for theoretical concepts
- Join our community for support
Congratulations! You've set up MLVisual on macOS correctly.