Add Dependencies
How to add python and non-python dependencies to your app
Python Dependencies
You have two options for specifying Python dependencies:
Option 1: Using a requirements.txt file
Create a file named requirements.txt in your project root and list each dependency on a separate line.
For example:
python-fasthtml
monsterui
fastcoreOption 2: Using PEP723 inline dependencies
Add dependencies directly to the top of your main.py file using the PEP723 format.
For example:
# /// script
# dependencies = [
# "python-fasthtml",
# "monsterui",
# "fastcore",
# ]
# ///
# rest of your app below
Important
Use only one method to declare your Python dependencies. If you use both you’ll receive an error.
Non-Python Dependencies
For system packages create a setup.sh file in your project root.
For example:
#!/bin/bash
apt update -y
apt install -y imagemagick
apt install -y ffmpeg
Tip
This script runs during the build process with root privileges, so you don’t need to use sudo.
Troubleshooting dependency installation issues
Check your app’s build logs for error messages via the web dashboard, or CLI.
On the web dashboard:
- Go to https://pla.sh/dashboard
- Find your app in the list
- Click on “View Logs”
- Click on “Build Logs”
On the CLI:
- Navigate to project root directory
- Run CLI command:
plash_logs
Look for where requirements.txt or setup.sh runs. Th output will provide guidance on the cause of your issue.