Setup Guide
July 24, 2026 ยท View on GitHub
Complete installation and configuration guide for IBM Diagrams.
๐ Table of Contents
Prerequisites
Required Software
| Software | Minimum Version | Purpose | Download Link |
|---|---|---|---|
| Python | 3.12+ | Runtime environment | python.org |
| draw.io Desktop | Latest | View/edit diagrams | GitHub Releases |
Recommended Software
| Software | Purpose | Download Link |
|---|---|---|
| uv | Fast package manager (10-100x faster than pip) | astral.sh/uv |
| IBM Plex Sans | Proper font rendering | Google Fonts |
Installation Methods
Method 1: Using uv (Recommended) โก
Why uv?
- 10-100x faster than pip
- Automatic virtual environment management
- Automatic Python version management
- Better dependency resolution
Install uv
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Alternative (using pip):
pip install uv
Install IBM Diagrams with uv
# Clone or download the repository
git clone git@github.com:IBM/ibmdiagrams.git
cd ibmdiagrams
# Install all dependencies (creates virtual environment automatically)
uv sync
# Verify installation
uv run ibmdiagrams --help
Running with uv
# Run CLI commands
uv run ibmdiagrams cloud.tfstate
# Run Python scripts
uv run python docs/examples/slzvsi.py
# Install additional packages
uv pip install <package-name>
Method 2: Using pip (Traditional)
Step 1: Install Python
macOS:
# Download from python.org or use Homebrew
brew install python@3.12
# Verify installation
python3 --version
Windows:
- Download installer from python.org
- Run installer and check "Add Python to PATH"
- Verify:
python --version
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install python3.12 python3.12-venv python3-pip
Step 2: Install pip
# Usually included with Python 3.12+
# If needed, install manually:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
Step 3: Install IBM Diagrams
# Download wheel from Releases
# https://github.com/your-repo/ibmdiagrams/releases
# Install the package
pip install ibmdiagrams-3.1.10-py3-none-any.whl
# Verify installation
ibmdiagrams --help
Installation Location:
- macOS/Linux:
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ibmdiagrams - Windows:
C:\Users\<username>\AppData\Local\Programs\Python\Python311\Lib\site-packages\ibmdiagrams
Method 3: Development Installation
For contributors and developers:
# Clone repository
git clone git@github.com:IBM/ibmdiagrams.git
cd ibmdiagrams
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
# Install in editable mode with dev dependencies
pip install -e .
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
Font Installation
IBM Plex Sans fonts are required for proper diagram rendering in draw.io desktop.
Available Fonts
IBM Diagrams supports these IBM Plex Sans variants:
- IBM Plex Sans (default) - Latin script
- IBM Plex Sans Arabic - Arabic script
- IBM Plex Sans Devanagari - Devanagari script
- IBM Plex Sans Hebrew - Hebrew script
- IBM Plex Sans JP - Japanese script
- IBM Plex Sans KR - Korean script
- IBM Plex Sans Thai - Thai script
Installation Steps
macOS
- Visit Google Fonts - IBM Plex
- Select IBM Plex Sans (or desired variant)
- Click Get font โ Download all
- Unpack
IBM_Plex_Sans.zip - Open Font Book app
- Select File โ Add Fonts to Current User
- Select the unpacked folder
- Restart draw.io desktop
Verification:
- Open draw.io desktop
- Create a text box
- Set font to "IBM Plex Sans"
- Type a lowercase "l" - it should have a slight right bend at the bottom
Windows
- Download fonts from Google Fonts
- Unpack the ZIP file
- Select all
.ttffiles - Right-click โ Install (or Install for all users)
- Restart draw.io desktop
Linux
# Download fonts
wget https://fonts.google.com/download?family=IBM%20Plex%20Sans -O ibm-plex-sans.zip
# Create fonts directory if it doesn't exist
mkdir -p ~/.local/share/fonts/ibm-plex-sans
# Extract fonts
unzip ibm-plex-sans.zip -d ~/.local/share/fonts/ibm-plex-sans
# Refresh font cache
fc-cache -f -v
# Verify installation
fc-list | grep "IBM Plex Sans"
Using Custom Fonts
To use a different IBM Plex Sans variant:
# CLI
ibmdiagrams -font "IBM Plex Sans JP" cloud.tfstate
# Python API
with Diagram("my-diagram", font="IBM Plex Sans JP"):
pass
Verification
Verify Installation
# Check version
ibmdiagrams --version
# Show help
ibmdiagrams --help
# Test with example (using uv)
uv run python docs/examples/slzvsi.py
# Test with example (using pip)
python docs/examples/slzvsi.py
Verify Fonts
- Open draw.io desktop
- Create a new diagram
- Add a text box
- Set font to "IBM Plex Sans"
- Type: "The quick brown fox jumps over the lazy dog"
- Verify the font renders correctly (lowercase "l" has slight right bend)
Run Example Diagram
# Create a test file
cat > test-diagram.py << 'EOF'
from ibmdiagrams.ibmcloud.diagram import Diagram
from ibmdiagrams.ibmcloud.groups import IBMCloud, Region, VPC
from ibmdiagrams.ibmcloud.compute import VirtualServer
with Diagram("test"):
with IBMCloud("IBM Cloud"):
with Region("Dallas"):
with VPC("Test VPC"):
vsi = VirtualServer("Test Server")
EOF
# Run it
python test-diagram.py
# Open the output
open test.drawio # macOS
start test.drawio # Windows
xdg-open test.drawio # Linux
Troubleshooting
Common Issues
Issue: Command not found: ibmdiagrams
Symptoms:
$ ibmdiagrams --help
bash: ibmdiagrams: command not found
Solutions:
-
Using uv: Run with
uv run ibmdiagramsinsteaduv run ibmdiagrams cloud.tfstate -
Using pip: Add Python's bin directory to PATH
# macOS/Linux - Add to ~/.bashrc or ~/.zshrc export PATH="$HOME/.local/bin:$PATH" # Windows - Add to System Environment Variables # C:\Users\<username>\AppData\Local\Programs\Python\Python311\Scripts -
Verify installation location
pip show ibmdiagrams
Issue: Import errors when running Python scripts
Symptoms:
ModuleNotFoundError: No module named 'ibmdiagrams'
Solutions:
-
Using uv: Run with
uv run pythonuv run python my-diagram.py -
Using pip: Activate virtual environment
source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows -
Verify installation
python -c "import ibmdiagrams; print(ibmdiagrams.__version__)"
Issue: Fonts not rendering correctly in draw.io
Symptoms:
- Text appears in default font instead of IBM Plex Sans
- Lowercase "l" looks like "I" (no right bend)
Solutions:
-
Install IBM Plex Sans fonts (see Font Installation)
-
Restart draw.io desktop after installing fonts
-
Verify font installation
# macOS fc-list | grep "IBM Plex Sans" # Windows - Check in Font Settings # Settings โ Personalization โ Fonts -
Use alternative font temporarily
ibmdiagrams -font "Arial" cloud.tfstate
Issue: Python version too old
Symptoms:
ERROR: Python 3.12 or higher is required
Solutions:
-
Install Python 3.12+
- macOS:
brew install python@3.12 - Windows: Download from python.org
- Linux:
sudo apt install python3.12
- macOS:
-
Use uv (automatically manages Python versions)
uv sync # Installs correct Python version automatically
Issue: Permission denied when installing
Symptoms:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied
Solutions:
-
Use user installation (recommended)
pip install --user ibmdiagrams-*.whl -
Use virtual environment (best practice)
python3 -m venv venv source venv/bin/activate pip install ibmdiagrams-*.whl -
Use uv (handles permissions automatically)
uv sync
Issue: draw.io won't open .drawio files
Symptoms:
- Double-clicking .drawio files doesn't open draw.io
- Files open in text editor instead
Solutions:
-
Set draw.io as default application
- macOS: Right-click file โ Get Info โ Open with โ draw.io โ Change All
- Windows: Right-click file โ Open with โ Choose another app โ draw.io โ Always use
- Linux: Right-click file โ Properties โ Open With โ draw.io โ Set as default
-
Open manually
# macOS open -a "draw.io" diagram.drawio # Windows "C:\Program Files\draw.io\draw.io.exe" diagram.drawio # Linux drawio diagram.drawio
Command Comparison
Quick reference for uv vs pip commands:
| Task | uv | pip |
|---|---|---|
| Install dependencies | uv sync | pip install -r requirements.txt |
| Run script | uv run python script.py | python script.py |
| Run CLI | uv run ibmdiagrams file.tfstate | ibmdiagrams file.tfstate |
| Install package | uv pip install package | pip install package |
| Create environment | Automatic with uv sync | python -m venv venv |
| Activate environment | Not needed with uv run | source venv/bin/activate |
Next Steps
Now that you're set up:
- ๐ Getting Started Guide - Create your first diagram
- ๐ Diagram as Code - Learn the Python API
- ๐ Terraform Guide - Generate diagrams from Terraform
- ๐ Examples - Explore real-world diagrams
Additional Resources
- IBM Design Language: Technical Diagrams Guideline
- draw.io Documentation: draw.io Help
- Python Virtual Environments: venv Documentation
- uv Documentation: uv Guide
License
This application is licensed under the Apache License, Version 2.0. Separate third-party code objects invoked by this application are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.