For AI agents: this page in Markdown: https://www.pubnub.com/docs/sdks/asyncio/set-up-your-environment.md. Documentation index: https://www.pubnub.com/llms-full.txt.
Set up your Python-Asyncio environment
This guide installs the PubNub Python SDK, the pubnub package, for use with asyncio. The package provides the PubNubAsyncio client. The SDK requires Python 3.9 or later.
SDK version
Always use the latest SDK version to have access to the newest features and avoid security vulnerabilities, bugs, and performance issues.
Install the SDK
Install the pubnub package with pip:
1pip install pubnub
To separate the SDK from other projects, install it in a virtual environment:
1python -m venv .venv
2source .venv/bin/activate
3pip install pubnub
To build the SDK yourself, clone the GitHub repository:
1git clone https://github.com/pubnub/python
For compatibility details, see Platform support.
Next steps
- Send your first message in the Quickstart.
- Set up the client in Configuration.