Quick Start: Installing Dependencies via UI
The easiest way to install dependencies is through the Mage UI: description: “Install dependencies using requirements.txt”
Mage Pro makes dependency management simple through the requirements.txt file in your workspace’s root folder. Adding new packages doesn’t require cluster restarts, so you can immediately run your code after installation. Installing dependencies in Mage Pro can be done through the requirements.txt file located in the project folder of your cluster or workspace.
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.
Learn More
For advanced dependency management features including environment fingerprinting, cleanup policies, and programmatic usage, see the complete Dependency Management guide. Follow these steps to add and install requirements:- Click the requirements.text file to open the file in your editor
- Add your packages to the file and save it
- Navigate to the terminal page
- Run
pip install -r requirements.txt
Following this steps will install your requirements and you will not need to restart the cluster after installation. You can run your code as written