System Requirements
Before installing pyinfra, ensure your system meets these requirements:Python Version
Python Version
pyinfra requires Python 3.10 or higher. Supported versions:
- Python 3.10
- Python 3.11
- Python 3.12
- Python 3.13
Operating System
Operating System
pyinfra works on:
- Linux (all major distributions)
- macOS (Intel and Apple Silicon)
- Windows (via WSL2 recommended)
Dependencies
Dependencies
pyinfra will automatically install these Python dependencies:
gevent>=1.5- Concurrent execution engineparamiko>=2.7,<4- SSH connectivityclick>2- CLI frameworkjinja2>3,<4- Template renderingpython-dateutil>2,<3- Date handlingdistro>=1.6,<2- OS detectionpackaging>=16.1- Version parsingpydantic>=2.11,<3- Data validation
Installation Methods
Using uv (Recommended)
uv is the fastest Python package installer. Install pyinfra as a tool:Using pipx
pipx installs Python CLI tools in isolated environments:pipx is great if you want pyinfra available globally but isolated from other Python projects.
Using pip
Install with pip for traditional Python package management:From Source
Install the latest development version directly from GitHub:Why install from source?
Why install from source?
- Access to unreleased features and bug fixes
- Contributing to pyinfra development
- Testing patches before official release
- Custom modifications for your use case
Verifying Installation
After installation, verify everything works correctly:If all three steps work, pyinfra is installed correctly!
Additional Setup
SSH Configuration
For SSH connectivity, ensure you have proper SSH setup:Docker Setup (Optional)
To use the Docker connector, install Docker:Enabling Shell Completion
pyinfra supports shell completion for bash, zsh, and fish:Troubleshooting
Common Issues
'pyinfra' command not found
'pyinfra' command not found
Problem: The
pyinfra command isn’t in your PATH.Solutions:- If using pipx: Run
pipx ensurepathand restart your shell - If using pip —user: Add
~/.local/binto your PATH: - If using virtual environment: Make sure it’s activated:
ImportError: No module named 'gevent'
ImportError: No module named 'gevent'
Problem: Dependencies weren’t installed correctly.Solution: Reinstall with dependencies:
Python version errors
Python version errors
Problem: System Python is too old (< 3.10).Solutions:
-
Install a newer Python version:
-
Use pyenv to manage Python versions:
Permission denied errors
Permission denied errors
Problem: Trying to install globally without sudo.Solutions:
- Use pipx or uv (recommended)
- Use pip with —user flag:
- Use a virtual environment
SSL certificate errors
SSL certificate errors
Problem: Corporate proxy or firewall blocking PyPI.Solutions:
-
Configure pip to use your proxy:
-
Use your organization’s PyPI mirror:
Docker connector not working
Docker connector not working
Problem: Can’t connect to Docker daemon.Solutions:
-
Ensure Docker is running:
-
Add your user to the docker group:
-
Check Docker socket permissions:
Upgrading pyinfra
Keep pyinfra up to date to get the latest features and bug fixes:Development Installation
For contributing to pyinfra or developing custom operations:Development dependencies include:
- pytest and pytest-cov for testing
- ruff for linting
- mypy for type checking
- ipython and ipdb for debugging
Uninstalling pyinfra
If you need to remove pyinfra:Next Steps
Now that pyinfra is installed:Quickstart Guide
Run your first deployment
Core Concepts
Understand how pyinfra works
CLI Reference
Master the command line interface
Operations
Explore available operations
Getting Help
If you encounter issues not covered here:GitHub Issues
Report bugs and installation problems
GitHub Discussions
Ask questions and get community support
Matrix Chat
Real-time chat with the community
Contributing Guide
Learn how to contribute to pyinfra
