---
source_url: https://www.pubnub.com/docs/sdks/asyncio/troubleshooting
title: Troubleshoot the PubNub Python-Asyncio SDK
updated_at: 2026-11-25T12:28:11.000Z
sdk_name: PubNub Python Asyncio SDK
sdk_version: 10.9.1
description: Learn how to find the version of your PubNub Python-Asyncio SDK for version-related troubleshooting.
---

# Troubleshoot the PubNub Python-Asyncio SDK

PubNub Python Asyncio SDK, use the latest version: 10.9.1

Install:

```bash
pip install pubnub==10.9.1
```

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

This page shows how to find the version of the PubNub Python-Asyncio SDK and log it for troubleshooting and support.

## How to find the version of your SDK

Your SDK version helps with troubleshooting and bug reports. Read it from the `SDK_VERSION` constant.

### Access your SDK version via constant

The following snippet prints the SDK version from the `PubNubAsyncio` class.

### Steps to access the SDK version

1. Import the required modules.
2. Retrieve the version with `PubNubAsyncio.SDK_VERSION`.
3. Log or print the version for future reference.

```python
import asyncio
import os
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub_asyncio import PubNubAsyncio

async def display_sdk_info(pubnub: PubNubAsyncio):
    # Get and display the SDK version
    sdk_version = PubNubAsyncio.SDK_VERSION
    print(f"PubNub Asyncio SDK Version: {sdk_version}")

if __name__ == "__main__":
    # Configuration for PubNub instance
    pn_config = PNConfiguration()
    pn_config.subscribe_key = os.getenv('SUBSCRIBE_KEY', 'demo')  # Replace 'demo' with your subscribe key from PubNub Admin Portal
    pn_config.publish_key = os.getenv('PUBLISH_KEY', 'demo')      # Replace 'demo' with your publish key from PubNub Admin Portal
    pn_config.user_id = "sdk_version_demo_user"

    # Create and configure the event loop
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    
    # Initialize PubNub
    pubnub = PubNubAsyncio(pn_config)
    
    try:
        # Display SDK version information
        loop.run_until_complete(display_sdk_info(pubnub))
    finally:
        # Clean up resources
        loop.run_until_complete(pubnub.stop())
        loop.close()
```

Use the SDK version to:

* Report issues to support
* Diagnose compatibility problems
* Check whether a feature is available
* Decide whether your application needs an upgrade

### Log the SDK version during initialization

Log the SDK version during initialization to keep a record of versions across deployments.

```python
import os
import logging
import asyncio
from pubnub import set_stream_logger
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub_asyncio import PubNubAsyncio

# Set up logging
logging.basicConfig(level=logging.INFO)
set_stream_logger('pubnub', logging.INFO)
logger = logging.getLogger('pubnub_app')

async def init_and_log_version(pubnub):
    logger.info(f"Initializing PubNub with SDK version: {PubNubAsyncio.SDK_VERSION}")
    
    # Demonstrate a basic operation to show logging in action
    try:
        time_response = await pubnub.time().future()
        logger.info(f"Current PubNub time: {time_response.result}")
    except Exception as e:
        logger.error(f"Error getting PubNub time: {e}")
        
    return pubnub

if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    
    # Configure PubNub
    pnconfig = PNConfiguration()
    pnconfig.subscribe_key = os.getenv('SUBSCRIBE_KEY', 'demo')  # Replace 'demo' with your subscribe key from PubNub Admin Portal
    pnconfig.publish_key = os.getenv('PUBLISH_KEY', 'demo')  # Replace 'demo' with your publish key from PubNub Admin Portal
    pnconfig.user_id = "logging_demo_user"
    pnconfig.ssl = True
    
    pubnub = PubNubAsyncio(pnconfig)
    
    try:
        loop.run_until_complete(init_and_log_version(pubnub))
        # Additional operations would go here
    finally:
        loop.run_until_complete(pubnub.stop())
        loop.close()
```

Last updated at: 2026-11-25T12:28:11.000Z
