Understanding how Python dependencies work in watsonx Orchestrate is critical for building secure, repeatable deployments across environments. This guide clarifies what gets packaged during export, when dependencies are installed, and which patterns are officially supported for enterprise deployments.Documentation Index
Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
Use this file to discover all available pages before exploring further.
What are “dependencies” in watsonx Orchestrate?
When you export a Python tool or agent, the export includes:- ✅ Your Python source code files (
.pyfiles) - ✅ Your
requirements.txtfile (dependency specifications) - ✅ Any additional resources (data files, configuration files)
- ❌ Does not include the installed binary packages or virtual environment
Example: What gets exported
When and where are dependencies installed?
Dependencies are installed server-side at agent deployment time, not during export or import.Installation timeline
- Development: You create a tool with a
requirements.txtfile - Import: You import the tool using
orchestrate tools import - Deployment: When the tool is deployed to an environment (Draft or Live):
- watsonx Orchestrate reads your
requirements.txt - Runs
pip installserver-side - Creates an isolated virtual environment (venv)
- Installs all specified packages
- watsonx Orchestrate reads your
This installation happens in every environment where you deploy the tool—DEV, QA, and PROD instances all perform their own dependency installation.
Virtual environment caching
To optimize performance and reduce redundant installations, watsonx Orchestrate uses a canonical hash-based deduplication mechanism:- Hash computation: When you deploy a tool, the system computes a unique fingerprint (hash) of your
requirements.txtfile - Cache check: The system checks if a virtual environment with this exact hash already exists
- Reuse or create:
- Hash match found: Reuses the existing cached venv (no installation needed)
- No match: Creates new hash, builds new venv, stores in cache
When a new virtual environment is created
A new venv will be created when the dependency hash changes due to:- Dependency version changes: Updating from
requests==2.32.3torequests==2.32.4 - Adding/removing packages: Adding
numpy==1.24.0to existing dependencies - Different registry URLs: Changing
--index-urlor--extra-index-url - ADK version changes: If you re-import with a different ADK version and have unpinned dependencies, ADK may add different “latest” versions
Enterprise dependency management patterns
Using private registries (Artifactory, Nexus)
watsonx Orchestrate supports pulling packages from private PyPI registries like Artifactory or Sonatype Nexus. This is essential for organizations that:- Require security scanning of all packages
- Cannot allow direct downloads from public PyPI
- Need to control which package versions are available
Configuration with --index-url
Use --index-url to specify your primary package registry:
requirements.txt
Configuration with --extra-index-url
Use --extra-index-url to add your registry as an additional source while keeping PyPI as a fallback:
requirements.txt
With
--extra-index-url, pip will check both your private registry AND public PyPI. This provides flexibility but may not meet strict security policies that prohibit any public PyPI access.Direct wheel URLs
You can also specify direct URLs to wheel files hosted in your registry:requirements.txt
Pinned dependencies for reproducibility
To ensure consistent builds across environments, always pin your dependencies to exact versions:✅ Recommended: Exact version pinning
requirements.txt
❌ Not recommended: Unpinned or range versions
requirements.txt
Hash-based verification for maximum security
For the highest level of reproducibility and security, usepip-compile to generate hashes:
requirements.txt with cryptographic hashes:
requirements.txt
- Compromised packages
- Registry tampering
- Accidental version mismatches
Export/import vs Git-based promotion
Understanding the difference between these deployment approaches is crucial for choosing the right strategy.Export/import model
What it provides:- Source code equivalence
- Configuration portability
- Quick environment setup
- Binary package equivalence (packages are re-installed in target environment)
- Guaranteed identical dependencies (unless using pinned versions + private registry)
- Moving agents between different watsonx Orchestrate instances
- Sharing agents with other teams or organizations
- Backing up agent configurations
After import, the QA environment will run
pip install using its own registry configuration, potentially pulling different package versions if dependencies are not pinned.Git-based promotion
What it provides:- Version control integration
- Commit-based traceability
- Code review workflows
- Binary package equivalence (packages are still re-installed)
- Protection against registry changes (unless using locked Artifactory)
- Standard CI/CD pipelines
- Promoting tested code through environments
- Maintaining audit trails
Achieving binary equivalence
Neither export/import nor Git-based promotion guarantees binary equivalence by default. To achieve it:- Pin all dependencies to exact versions in
requirements.txt - Use a locked private registry (Artifactory/Nexus) with controlled package versions
- Optional: Add hash verification with
pip-compile --generate-hashes - Ensure the same registry configuration across all environments
requirements.txt
- ✅ Same source code (via export/import or Git)
- ✅ Same dependency versions (pinned)
- ✅ Same binary packages (locked registry + hashes)
- ✅ Repeatable across all environments
Air-gapped environments
For deployments in air-gapped or restricted network environments, see the dedicated guide: Operating in an air-gapped environment. Key considerations:- ADK and all dependencies must be uploaded to your internal registry
- Use
--index-urlto point to your internal registry - Ensure all transitive dependencies are available
Best practices summary
Pin all versions
Use exact version pinning (
==) in requirements.txt for all dependenciesUse private registries
Configure
--index-url to pull from your organization’s Artifactory or NexusAdd hash verification
Use
pip-compile --generate-hashes for maximum security and reproducibilityLock your registry
Prevent package additions/removals in your Artifactory between deployments
Recommended requirements.txt template
requirements.txt
Troubleshooting
Issue: Different packages installed in QA vs PROD
Cause: Unpinned dependencies or registry changes between deployments Solution:- Pin all dependencies to exact versions
- Use a locked Artifactory with controlled package versions
- Verify registry configuration is identical across environments
Issue: Tool fails to import due to missing packages
Cause: Package not available in private registry Solution:- Verify package exists in your Artifactory/Nexus
- Check
--index-urlconfiguration inrequirements.txt - Ensure network connectivity from watsonx Orchestrate to your registry
Issue: Slow deployment times
Cause: Virtual environment cache misses due to hash changes Solution:- Use pinned versions to maximize cache hits
- Avoid unnecessary changes to
requirements.txt - Keep ADK version consistent across re-imports
Issue: Security scan failures
Cause: Packages pulled from public PyPI without scanning Solution:- Use
--index-url(not--extra-index-url) to prevent PyPI fallback - Configure your Artifactory to scan packages before making them available
- Implement package approval workflows in your registry

