Mage Pro includes an advanced dependency management system that automatically creates and manages isolated virtual environments for your projects. Adding new packages is simple and doesn’t require cluster restarts - you can immediately run your code after installation.Documentation Index
Fetch the complete documentation index at: https://docs.mage.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start: Installing Dependencies via UI
The easiest way to install dependencies is through the Mage UI:
Steps:
- Navigate to the Terminal page in your Mage workspace
-
Open
requirements.txt: Browse to/home/src/[project_path]/requirements.txtand click to open it in the editor -
Add your packages: Edit the file to include your dependencies
-
Click the “Install dependencies” button: This will automatically:
- Open a terminal at the bottom of the page
- Run
mage deps installcommand - Show real-time installation progress
- Install only the packages that need to be added or updated
Your dependencies are now installed and ready to use - no cluster restart required!
How It Works
Behind the scenes, Mage Pro’s dependency management system:- Creates isolated virtual environments for each unique combination of dependencies
- Caches and reuses environments based on content fingerprinting for faster installation
- Intelligently filters packages to reuse compatible packages from the global environment
- Uses
uvfor fast installation with automatic fallback topip - Automatically activates environments when the server starts
requirements.txt, ensuring your dependencies are always synchronized.
Alternative Methods
Via Mage Terminal
You can also run dependency commands directly in the Mage terminal:Automatic on Cluster Restart
When you restart your Mage cluster, dependencies are automatically installed based on yourrequirements.txt - no manual intervention needed.