Installing MapR Event Store For Apache Kafka Python Client

The MapR Event Store For Apache Kafka Python Client is a binding for librdkafka that is dependent on the MapR Event Store For Apache Kafka C client (MapR Event Store For Apache Kafka C Client is a distribution of librdkafka that works with MapR Event Store For Apache Kafka).

Prerequisites

NOTE As of MapR 5.2.1, you can create Python client applications for MapR Event Store For Apache Kafka.
Verify that the following components are installed on the node:
  • MapR Event Store For Apache Kafka C Client (mapr-librdkafka)
  • GNU Compiler Collection (GCC) is installed on the node.
  • Python version 2.7.1 and above, up to Python version 3.6.x.
  • Python pip
  • python-devel (This is required for nodes with the Linux operating system.)
NOTE For instructions on setting up the EEP repository, see Step 10: Install Ecosystem Components Manually.
IMPORTANT Because the MapR Event Store For Apache Kafka Python Client is dependent on the MapR Event Store For Apache Kafka C Client, you must configure the MapR Event Store For Apache Kafka C Client before using the MapR Event Store For Apache Kafka Python Client. See Configuring the MapR Event Store For Apache Kafka C Client.

Installation

NOTE The Python client is available for Linux or Mac operating systems.
To install the MapR Event Store For Apache Kafka Python Client using the Python Software Foundation, run the following command as root or using sudo:
  • On Linux:
    pip install --global-option=build_ext --global-option="--library-dirs=/opt/mapr/lib" --global-option="--include-dirs=/opt/mapr/include/" mapr-streams-python
  • On Mac:
    pip install --user --global-option=build_ext --global-option="--library-dirs=/opt/mapr/lib" --global-option="--include-dirs=/opt/mapr/include/" mapr-streams-python
NOTE The referenced package works on nodes with the Linux or the Mac operating system. The Python Client for MapR Event Store For Apache Kafka is not supported on Windows.
Alternatively, you can install the MapR Event Store For Apache Kafka Python Client via the MapR package repository:
https://package.ezmeral.hpe.com/releases/MEP/<MEP version>/mac/mapr-streams-python-<version>.tar.gz

Troubleshooting Mac OS Installation

If you install the MapR Event Store For Apache Kafka Python Client on a Mac without the --user flag, you may encounter a "Not Permitted" error, signifying that you don't have permission to create a LICENSE file. The error will look similar to the following:
Copying LICENSE -> /System/Library/Frameworks/Python.framework/Versions/2.7/
                error: [Error 1] Operation not permitted:
                '/System/Library/Frameworks/Python.framework/Versions/2.7/LICENSE'
To fix this issue, execute the following steps. These steps apply to users with a new Mac OS Sierra version 10.12.5.
  1. Reboot your Mac while simultaneously holding the Command and R keys to go into Mac OS X Recovery mode.
  2. Select Utilities, and then Terminal.
  3. Type csrutil disable. A message will pop up, informing you that your System Integrity Protection (SIP) has been sucessfully disabled.
  4. Reboot your Mac again.
  5. Go into the Terminal and execute the following command as the root user:
    pip install --global-option=build_ext  --global-option="--library-dirs=/opt/mapr/lib" --global-option="--include-dirs=/opt/mapr/include/" mapr-streams-python
  6. Once the script runs successfully, reboot your Mac while holding the Command and R keys. You will go into Mac OS X Recovery mode.
  7. Select Utilities, and then Terminal.
  8. Type csruntil enable to enable your SIP.
NOTE To avoid this error, consider using a virtual Python environment or the --user flag.