{"id":24262,"library":"prerun","title":"Prerun","description":"Prerun is a Python utility to run commands before another process starts, commonly used for environment setup, health checks, or dependency injection. Current version 1.1.3, released 2024, with occasional updates.","status":"active","version":"1.1.3","language":"python","source_language":"en","source_url":"https://github.com/sfanxiang/prerun","tags":["prerun","utility","command-runner","setup"],"install":[{"cmd":"pip install prerun","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import of top-level module; no subpackages needed.","wrong":"","symbol":"prerun","correct":"import prerun"}],"quickstart":{"code":"import prerun\n\n# Define a command to run before the main process\nprerun.run(['echo', 'Pre-run setup complete'])\n\n# Main process continues after prerun completes\nprint('Main process starting')","lang":"python","description":"Basic usage: prerun.run() executes a command sequentially before continuing."},"warnings":[{"fix":"Use threading or subprocess.Popen for async execution.","message":"prerun.run() blocks until the command finishes. Do not use for background tasks.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace with subprocess.Popen(command, cwd=path) if you need a working directory.","message":"The 'cwd' parameter in prerun.run() is deprecated since 1.1.0; use 'subprocess.Popen' with cwd instead.","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade: pip install --upgrade prerun. Ensure you have v1.0.0+.","cause":"Older prerun versions (<1.0.0) used a different API or the module was installed incorrectly.","error":"AttributeError: module 'prerun' has no attribute 'run'"},{"fix":"Use a full path or check that the command exists: prerun.run(['/usr/bin/echo', 'test']).","cause":"Passing a non-executable string or missing command. prerun.run() expects a command that is in PATH or a full path.","error":"FileNotFoundError: [Errno 2] No such file or directory: '...'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}