{"id":4939,"library":"easyprocess","title":"EasyProcess","description":"EasyProcess is a simple, easy-to-use Python subprocess interface, providing a convenient layer on top of the standard `subprocess` module. It simplifies starting and stopping programs, retrieving their standard output and error streams, and managing return codes. The library supports Python versions 3.7 through 3.12 and is currently at version 1.1.","status":"active","version":"1.1","language":"python","source_language":"en","source_url":"https://github.com/ponty/EasyProcess","tags":["subprocess","process management","automation","shell"],"install":[{"cmd":"pip install EasyProcess","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"EasyProcess","correct":"from easyprocess import EasyProcess"}],"quickstart":{"code":"import sys\nfrom easyprocess import EasyProcess\n\n# Get the Python executable path\npython_executable = sys.executable\n\n# Run a simple Python command, wait for it, and get stdout\nprocess_result = EasyProcess([python_executable, \"-c\", \"print('Hello from EasyProcess')\"]).call()\nprint(\"Stdout:\", process_result.stdout)\nprint(\"Return Code:\", process_result.return_code)","lang":"python","description":"This example demonstrates how to run a simple Python command using EasyProcess, wait for its completion, and retrieve its standard output and return code."},"warnings":[{"fix":"Always pass commands as a list of strings (e.g., `['command', 'arg1', 'arg2']`) instead of a single string. Ensure the base command refers to an actual executable.","message":"EasyProcess does not support shell commands. Commands should be provided as a list of arguments. Passing a string will be split using `shlex.split`, but shell-specific commands (like `echo` on Windows) might not work as expected if they are not standalone executables.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Access `stdout` and `stderr` only after the process has concluded, for instance, after calling `.call()` or after `.stop()` on a `start()`ed process.","message":"The `stdout` and `stderr` attributes of an `EasyProcess` object are only populated *after* the subprocess has finished execution (i.e., after `call()`, `wait()`, or `stop()` has completed and the process has terminated). Attempting to read them before the process ends will result in `None`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Check `return_code` only after the process has completed and the relevant method (`stop()` or `wait()`) has been invoked.","message":"The `return_code` attribute is `None` until the managed subprocess has completed its execution and either `EasyProcess.stop()` or `EasyProcess.wait()` has been called.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For scenarios requiring full process tree termination, consider external utilities (like `psutil` in Python) to identify and kill child processes, or ensure the executed program itself handles its child processes gracefully.","message":"The `stop()` method only terminates the main process started by `EasyProcess` and does *not* automatically kill the entire subprocess tree (i.e., any child processes spawned by the main process). This can lead to orphaned processes.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.1':54 '3.12':48 '3.7':46 'autom':58 'code':40 'conveni':15 'current':51 'easi':7 'easy-to-us':6 'easyprocess':1,2 'error':35 'interfac':12 'layer':16 'librari':42 'manag':38,57 'modul':23 'output':33 'process':56 'program':29 'provid':13 'python':10,44 'retriev':30 'return':39 'shell':59 'simpl':5 'simplifi':25 'standard':21,32 'start':26 'stop':28 'stream':36 'subprocess':11,22,55 'support':43 'top':18 'use':9 'version':45,53","created_at":"2026-04-12T16:47:10.972954+00:00","updated_at":"2026-04-16T14:45:35.907460+00:00","problems":[{"fix":"Install the library using pip: `pip install easyprocess`","cause":"The 'easyprocess' library is not installed in your Python environment or is not accessible within the current Python path.","error":"ModuleNotFoundError: No module named 'easyprocess'"},{"fix":"Install the missing external program using your system's package manager (e.g., `sudo apt-get install xvfb` on Debian/Ubuntu, or `sudo yum install xorg-x11-server-Xvfb` on CentOS/RHEL) or ensure it's in your system's PATH.","cause":"The `easyprocess` library, often used by other libraries like `pyvirtualdisplay`, attempts to execute an external command (e.g., `Xvfb` or `Xephyr`) that is not installed on the operating system.","error":"easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb', '-help'] OSError=[Errno 2] No such file or directory"},{"fix":"Use the `EasyProcess` class instead: `from easyprocess import EasyProcess`","cause":"The class or function named 'Proc' is not part of the public API or has been renamed/removed in the version of `easyprocess` you are using. The primary class for creating subprocesses is `EasyProcess`.","error":"ImportError: cannot import name 'Proc' from 'easyprocess'"},{"fix":"Examine the `stderr` and `stdout` attributes of the `EasyProcess` object for more details on why the command failed. Debug the external command directly in your terminal to understand its expected behavior and potential errors. You can access these like `process = EasyProcess(cmd).call(); print(process.stdout); print(process.stderr)`.","cause":"The external command executed by `easyprocess` (which wraps Python's `subprocess` module) exited with a non-zero status code, indicating an error during the command's execution.","error":"CalledProcessError: Command '['some_command', 'arg1']' returned non-zero exit status X."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ponty/easyprocess","docs":null,"changelog":null,"pypi":"https://pypi.org/project/easyprocess/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}