Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Updating Python installation section #17796

Merged
merged 4 commits into from
Sep 27, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions site2/docs/client-libraries-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,21 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
````

You can use a Pulsar Python client to create producers, consumers, and readers.

Pulsar Python client library is a wrapper over the existing [C++ client library](client-libraries-cpp.md) and exposes all of the [same features](/api/cpp). You can find the code in the [Python directory](https://github.com/apache/pulsar/tree/master/pulsar-client-cpp/python) of the C++ client code.
tisonkun marked this conversation as resolved.
Show resolved Hide resolved
All the methods in producer, consumer, and reader of a Python client are thread-safe. You can read the API docs for the Python client [here](/api/python).
tisonkun marked this conversation as resolved.
Show resolved Hide resolved

All the methods in producer, consumer, and reader of a Python client are thread-safe.
## Installation

pdoc-generated API docs for the Python client are available [here](/api/python).
Use [pip](https://pip.pypa.io/) to install the latest version:
tisonkun marked this conversation as resolved.
Show resolved Hide resolved

## Install

You can install the [`pulsar-client`](https://pypi.python.org/pypi/pulsar-client) library either via [PyPi](https://pypi.python.org/pypi), using [pip](#installation-using-pip), or by building the library from [source](https://github.com/apache/pulsar/tree/master/pulsar-client-cpp).

### Install using pip

To install the `pulsar-client` library as a pre-built package using the [pip](https://pip.pypa.io/en/stable/) package manager:

```shell
pip install pulsar-client==@pulsar:version_number@
```bash
pip install 'pulsar-client==@pulsar:version_number@'
```

### Optional dependencies
If you install the client libraries on Linux to support services like Pulsar functions or Avro serialization, you can install optional components alongside the `pulsar-client` library.
You can install optional components alongside the client library:

```shell
```bash
# avro serialization
pip install 'pulsar-client[avro]==@pulsar:version_number@'

Expand All @@ -44,23 +36,10 @@ pip install 'pulsar-client[all]==@pulsar:version_number@'

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


### Install from source

To install the `pulsar-client` library by building from source, follow [instructions](client-libraries-cpp.md#compilation) and compile the Pulsar C++ client library. That builds the Python binding for the library.

To install the built Python bindings:

```shell
git clone https://github.com/apache/pulsar
cd pulsar/pulsar-client-cpp/python
sudo python setup.py install
```
Comment on lines -53 to -63
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply incorrect. We should update the doc in README.md under pulsar-client-cpp and add back this section to guide users there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really complex to build the Python client "correctly" from source right now. See #17468.

| 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 |

## Connection URLs

Expand Down