Fabric Classic
raw JSON → 1.21.0 verified Fri May 01 auth: no python
fab-classic is a maintained fork of the original Fabric 1.x line, providing a simple, Pythonic tool for remote execution and deployment via SSH. The current version is 1.21.0, with quarterly releases and support for Python 3.5+.
pip install fab-classic Common errors
error ImportError: No module named fabric.api ↓
cause Installed Fabric 2+ (fabric3) instead of fab-classic.
fix
Uninstall fabric/fabric3 and install fab-classic: pip uninstall fabric; pip install fab-classic.
error paramiko.ssh_exception.SSHException: Error reading protocol banner ↓
cause Network issue or server drops connection early.
fix
Increase timeout or retry: env.timeout = 30; env.connection_attempts = 3.
error TypeError: _pty_size() got an unexpected keyword argument 'height' ↓
cause Incompatible with Python 3.14 (struct buffer size change).
fix
Upgrade to fab-classic>=1.20.2.
Warnings
breaking Python 2.7 support dropped in 1.20.0 ↓
fix Upgrade to Python 3.5+ or pin fab-classic<1.20.0.
gotcha Parallel mode may hang on macOS Python 3.8+ without explicit fork context. Use env.parallel = True with caution. ↓
fix Set multiprocessing context to 'fork': import multiprocessing as mp; mp.set_start_method('fork') before using --parallel.
deprecated paramiko-ng is no longer supported by default; use upstream paramiko. ↓
fix Ensure paramiko (not paramiko-ng) is installed.
gotcha local() capture behavior changed in 1.19.0; failing commands with capture=False no longer raise SystemExit. ↓
fix Check return code explicitly if using capture=False.
Imports
- run wrong
from fabric import runcorrectfrom fabric.api import run
Quickstart
from fabric.api import run, env, cd
env.host_string = 'example.com'
env.user = 'user'
with cd('/var/www'):
run('ls -la')
run('uname -a')