asyncvnc

raw JSON →
1.3.0 verified Fri May 01 auth: no python

asyncvnc is an asynchronous VNC client library for Python, built on top of asyncio. It provides a high-level interface for VNC connections with full RFB protocol support. The current version is 1.3.0, supporting Python 3.7+. The project is actively maintained with sporadic releases.

pip install asyncvnc
error ModuleNotFoundError: No module named 'asyncvnc'
cause Library not installed.
fix
Run: pip install asyncvnc
error RuntimeError: Cannot close a running event loop
cause Calling asyncio.run() inside a running loop in Jupyter or nested async code.
fix
Use await client.close() explicitly or manage the loop manually. For Jupyter, use await main() directly.
error AttributeError: module 'asyncvnc' has no attribute 'client'
cause Using an outdated import path.
fix
Use 'from asyncvnc import VNCClient' instead of 'import asyncvnc.client'.
error TypeError: VNCClient() missing 1 required positional argument: 'password'
cause Password not provided when required.
fix
Provide the password argument: VNCClient(..., password='your_password')
error ValueError: unknown authentication method
cause Unsupported VNC authentication type (e.g., VeNCrypt, MSLogon).
fix
asyncvnc only supports standard VNC authentication (VNC Auth). Ensure server is configured accordingly.
gotcha The library requires an event loop to be running (asyncio). Using synchronous code will fail.
fix Ensure all calls are within an async function and run with asyncio.run() or similar.
gotcha The 'screenshot()' method returns a PIL Image object (Pillow must be installed).
fix Install Pillow: pip install Pillow
deprecated The old import path 'asyncvnc.client' may not work in future versions; use 'from asyncvnc import VNCClient'.
fix Update import to 'from asyncvnc import VNCClient'.

Connect to a VNC server, capture a screenshot, and close.

import asyncio
from asyncvnc import VNCClient

async def main():
    async with VNCClient(host='localhost', port=5900, password='secret') as client:
        screenshot = await client.screenshot()
        print('Screenshot captured')

if __name__ == '__main__':
    asyncio.run(main())