0% found this document useful (0 votes)
641 views

BLPAPI Python SDK On Windows: Installation Guide

This document provides instructions for installing the Bloomberg BLPAPI Python SDK on Windows. It covers downloading and extracting the C++ and Python SDKs, setting environment variables, installing via pip or from a local wheel file, verifying the installation, and troubleshooting tips.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
641 views

BLPAPI Python SDK On Windows: Installation Guide

This document provides instructions for installing the Bloomberg BLPAPI Python SDK on Windows. It covers downloading and extracting the C++ and Python SDKs, setting environment variables, installing via pip or from a local wheel file, verifying the installation, and troubleshooting tips.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BLPAPI Python SDK on Windows

Installation Guide

Document Version 2.0


April 2020

Bloomberg
FOR ENTERPRISE
Prerequisites
1. Python interpreter (list supported versions)
2. Pip command.
3. Access to Bloomberg CSC to download the BLPAPI SDK

Installation

1. Download the BLPAPI C++ SDK for Windows from Bloomberg CSC as follows:
Click Products > Download Center > SDK Windows > click B-Pipe/Platform/Server API for C++,
.NET, Java, Python …
Or, click here for a direct link.

2. Open the compressed file then extract both C++ API and Python subfolders into a local
folder.

3. Set BLPAPI_ROOT environment variable to point to location of C++ SDK


set BLPAPI_ROOT C:\...\C++API\v3.14.3.1

4. Open a CMD box the type in the following command:


Python -m pip install --index-url=https://bloomberg.bintray.com/pip/simple blpapi

If the command fails for any reason then please install the package from a local file. See
section Installing BLPAPI Package from a local file below.
Verify installation
To verify that the BLPAPI Package is installed successfully:

Open CMD box then type the following command:

C:\Python>pip list | findstr -i blpapi


blpapi (3.12.2)

If installation failed, please review Troubleshooting section below.

Runtime
1. Add location of C++ libraries to PATH environment variable, for example:
set path=%PATH%;C:\...\C++API\v3.14.3.1\lib

2. Verify that BLPAPI package is accessible and can be imported, as follows:

C:\>Python
Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC
v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import blpapi
>>>

3. Test one or more code examples from BLPAPI SDK :


- Go to \examples folder in Python SDK, e.g. C:\...\Python\v3.14.0\examples
- Run the code example SubscriptionWithEventHandlerExample.py:

Python SubscriptionWithEventHandlerExample.py –ip <B-Pipe IP> -p 8194 ...

Please review troubleshooting section below if any errors occurred.


Installing BLPAPI Package from a local file
If it’s not possible to install BLPAPI SDK using PIP command then try installing using a Wheel file,
as follows:

1. Go to https://bintray.com/bloomberg/pip/blpapi#files/simple/blpapi
2. Click Files
3. Select the package that matches your Operating System, bit-version, hardware, and Python version,
for example, blpapi-3.12.2-cp35-cp35m-win32.whl, then save to a local folder.

4. Run the following command:


pip install <package-file>
for example:
pip install blpapi-3.12.2-cp27-cp27m-win32.whl

the output should look like this:


Processing c:\temp\python\wheels\blpapi-3.12.2-cp27-cp27m-
win32.whl
Installing collected packages: blpapi
Successfully installed blpapi-3.12.2

5. Follow steps in sections Verify Installation and Runtime sections above.


Troubleshooting
1. Verify that BLPAPI_ROOT environment variable is set properly.

2. Verify the right version of the C++ library (blpapi3_32.dll or blpapi3_64.dll) can be located in
PATH, as follows:
a. Open a CMD box then type C:\>where blpapi3_*.dll
b. Verify the first item in the list is the right version that match Python SDK.
If you still unable to run the code examples, please contact Bloomberg Support and provide the
output of each of the installation steps to Bloomberg for further assistance.

You might also like