This is the recommended and production-safe way to add Python dependencies to a Frappe app such as google_services.
Open the file:
apps/google_services/pyproject.toml
Add dependencies under the project section:
[project]
dependencies = [
"requests>=2.31.0"
]Install dependencies into the bench virtual environment:
bench setup requirementsThis approach:
- Installs dependencies into the bench venv
- Works across machines, CI, and production
- Is the current Frappe standard
If the app already uses requirements.txt, add:
apps/google_services/requirements.txt
requests>=2.31.0Then run:
bench setup requirements- Do not run
pip installmanually - Do not install dependencies globally
- Do not import libraries without declaring them
- Do not modify bench-level requirements
These approaches will break on redeploy or CI.
- Bench scans all installed apps
- Reads
pyproject.tomlorrequirements.txt - Installs dependencies into the shared virtualenv
bench consoleimport requests
requests.__version__For Google Places integration, start with:
dependencies = [
"requests>=2.31.0"
]Add additional dependencies only when required.