{"id":3862,"library":"aioconsole","title":"Asynchronous Console and Interfaces for asyncio","description":"aioconsole provides asynchronous equivalents to built-in functions like input(), print(), and exec() for use within asyncio applications. It includes an interactive loop for running an asynchronous Python console and a script (apython) to access asyncio code at runtime. The library is actively maintained, with regular updates to support newer Python versions.","status":"active","version":"0.8.2","language":"python","source_language":"en","source_url":"https://github.com/vxgmichel/aioconsole","tags":["asyncio","console","interactive","repl","input","output","async-io"],"install":[{"cmd":"pip install aioconsole","lang":"bash","label":"Install aioconsole"}],"dependencies":[{"reason":"Requires Python 3.8 or higher.","package":"python","optional":false}],"imports":[{"symbol":"ainput","correct":"from aioconsole import ainput"},{"symbol":"aprint","correct":"from aioconsole import aprint"},{"symbol":"aexec","correct":"from aioconsole import aexec"},{"note":"Added in v0.8.0. Asynchronous equivalent to eval().","symbol":"aeval","correct":"from aioconsole import aeval"},{"symbol":"interact","correct":"from aioconsole import interact"}],"quickstart":{"code":"import asyncio\nfrom aioconsole import ainput, aprint\n\nasync def main():\n    await aprint(\"Enter your name:\")\n    name = await ainput(\"> \")\n    await aprint(f\"Hello, {name}!\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates basic asynchronous input and output using `ainput` and `aprint`. Run this script and type in the console when prompted."},"warnings":[{"fix":"Upgrade your Python environment to 3.8 or newer.","message":"Python 3.7 support was deprecated in aioconsole v0.7.0. Subsequent versions (0.7.0+) require Python 3.8 or higher. Python 3.7 has reached its official End-of-Life.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Evaluate if a more powerful async-compatible REPL or prompting library better suits your advanced interactive needs.","message":"For complex interactive console applications or rich input prompts, more feature-rich libraries like IPython, ptpython, or prompt_toolkit (for ainput alternatives) are often recommended over aioconsole due to its inherent limitations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure you are using aioconsole v0.7.1 or newer for more robust handling of standard stream protection.","message":"Versions prior to 0.7.1 might have had issues with 'more robust protection against the closing of standard streams', which implies potential unexpected behavior if sys.stdin/sys.stdout were closed externally.","severity":"gotcha","affected_versions":"<0.7.1"}],"env_vars":null,"search_vec":"'access':42 'activ':50 'aioconsol':7 'applic':25 'apython':40 'async':67 'async-io':66 'asynchron':1,9,34 'asyncio':6,24,43,60 'built':13 'built-in':12 'code':44 'consol':2,36,61 'equival':10 'exec':20 'function':15 'includ':27 'input':17,64 'interact':29,62 'interfac':4 'io':68 'librari':48 'like':16 'loop':30 'maintain':51 'newer':57 'output':65 'print':18 'provid':8 'python':35,58 'regular':53 'repl':63 'run':32 'runtim':46 'script':39 'support':56 'updat':54 'use':22 'version':59 'within':23","created_at":"2026-04-12T03:30:48.840562+00:00","updated_at":"2026-04-17T14:44:36.639922+00:00","problems":[{"fix":"pip install aioconsole","cause":"The 'aioconsole' package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'aioconsole'"},{"fix":"Ensure you have the latest version of 'aioconsole' installed: pip install --upgrade aioconsole","cause":"The 'ainput' function is not available in the installed version of 'aioconsole'.","error":"ImportError: cannot import name 'ainput' from 'aioconsole'"},{"fix":"Run 'apython' directly from the command line, not as an import in Python.","cause":"The 'apython' script is not an attribute of the 'aioconsole' module; it's a separate command-line tool.","error":"AttributeError: module 'aioconsole' has no attribute 'apython'"},{"fix":"Use 'await' when calling asynchronous functions: result = await aioconsole.ainput('Prompt: ')","cause":"Attempting to call an asynchronous function without awaiting it.","error":"TypeError: 'coroutine' object is not callable"},{"fix":"Use 'await' directly in interactive environments or manage the event loop appropriately in scripts.","cause":"Trying to run an event loop that is already running, often in interactive environments.","error":"RuntimeError: This event loop is already running"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.8.2","cli_name":"apython","cli_version":"usage: apython [-h] [--serve [HOST:] PORT] [--no-readline]","type":"library","homepage":null,"github":"https://github.com/vxgmichel/aioconsole","docs":null,"changelog":null,"pypi":"https://pypi.org/project/aioconsole/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-29","next_check":"2026-07-28","install_tag":null}}