Installing MapR-ES Python Client

As of MapR 5.2.1, you can install the MapR-ES Python Client on Linux or Mac operating systems.

For instructions on setting up the MEP repository, see Step 8: Install Ecosystem Components Manually
Verify that the following components are installed on the node:
  • MapR-ES C Client (mapr-librdkafka)
  • GNU Compiler Collection (GCC) is installed on the node.
  • Python 2.7.1 and above or Python 3.x
  • Python pip
  • python-devel (This is required for nodes with the Linux operating system.)
Important: As the MapR-ES C Client is a dependency for the MapR-ES Python Client, you must perform the steps to configure the MapR-ES C Client before you start using the MapR-ES Python Client. See Configuring the MapR Streams C Client.
To install the MapR-ES 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.

Troubleshooting Mac OS Installation

If you install the MapR-ES 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:
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.