Dependency Management
Pytron provides a zero-config dependency management workflow. It automatically handles virtual environments so you don't have to worry about conflicting packages or system-wide installations.
The Pytron Venv
When you initialize a project or run an install command, Pytron creates a specialized virtual environment (usually in a hidden .pytron_env or similar internal directory). This environment is used exclusively by your app during development and packaging.
Commands
Installing Packages
Use the pytron install command to add packages. This automatically detects your OS and installs the correct binaries.
# Install a single package
pytron install numpy
# Install multiple packages
pytron install pandas requests toggl-pythonThe requirements.json
Instead of a standard requirements.txt, Pytron uses a modern requirements.json file to track dependencies. This allows for better metadata and platform-specific targeting in the future.
{
"dependencies": [
"pytron-kit",
"numpy",
"requests"
]
}Running pytron install without any arguments will sync your virtual environment with the requirements.json.
Uninstalling
pytron uninstall numpyThis removes the package from the internal venv and updates the requirements.json manifest automatically.
Shared Runtimes
If you have multiple Pytron projects, they can share a global "base" environment to save disk space, while maintaining project-specific overlays for unique dependencies.
Complex Dependencies
For heavy libraries like PyTorch, TensorFlow, or llama-cpp-python, use the force-package flag in your settings.json to ensure the compiler (Nuitka or Shield) includes the necessary shared libraries (.dll/.so) in the final bundle.