HTTP/2 200
server: Apache
last-modified: Sun, 10 Aug 2025 01:42:26 GMT
etag: "a28b-63bf8eb4eee99-gzip"
content-encoding: gzip
access-control-allow-origin: *
content-security-policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/ https://*.algolia.net/ https://*.algolianet.com/ https://*.algolia.io/; script-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/ https://*.algolia.net/ https://*.algolianet.com/ https://*.algolia.io/; style-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/ https://*.algolia.net/ https://*.algolianet.com/ https://*.algolia.io/; frame-ancestors 'self'; frame-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/ https://*.algolia.net/ https://*.algolianet.com/ https://*.algolia.io/; worker-src 'self' data: blob:;
content-type: text/html
via: 1.1 varnish, 1.1 varnish
accept-ranges: bytes
age: 0
date: Fri, 15 Aug 2025 22:44:33 GMT
x-served-by: cache-hel1410022-HEL, cache-bom-vanm7210071-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1755297873.358697,VS0,VE454
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
content-length: 7689
Set up Python client | Apache Pulsar
Version: 4.0.x On this page
To set up Python client library in Pulsar, complete the following steps.
Step 1: Install Python client library
Use pip to install the latest version:
pip install 'pulsar-client==3.8.0'
You can install optional components alongside the client library:
pip install 'pulsar-client[avro]==3.8.0' pip install 'pulsar-client[functions]==3.8.0' pip install 'pulsar-client[all]==3.8.0'
Installation via PyPi is available for the following Python versions:
Platform Supported Python versions macOS (>= 11.0) 3.7, 3.8, 3.9 and 3.10 Linux (including Alpine Linux) 3.7, 3.8, 3.9 and 3.10
Step 2: Connect to Pulsar cluster
To connect to Pulsar using client libraries, you need to specify a Pulsar protocol URL.
You can assign Pulsar protocol URLs to specific clusters and use the pulsar
scheme. The following is an example of localhost
with the default port 6650
:
If you have multiple brokers, separate IP:port
by commas:
If you use mTLS authentication, add +ssl
in the scheme:
pulsar+ssl://pulsar.us-west.example.com:6651