How to install Bloomberg API Library for Python 2.7 on Mac OS X

Nyxynyx picture Nyxynyx · Sep 6, 2016 · Viewed 7.3k times · Source

I'm trying to setup my Mac OS X system to use the pdblp Python library which requires me to first install the Bloomberg Open API libary for Python. After cloning the git repo and running python setup.py install, I get

File "setup.py", line 20, in <module>
  raise Exception("BLPAPI_ROOT environment variable isn't defined")
Exception: BLPAPI_ROOT environment variable isn't defined

How should I proceed?

Answer

mob picture mob · Oct 14, 2016

You also need to install the C/C++ libraries and then set BLPAPI_ROOT to the location of the libblpapi3_32.so or libblpapi3_64.so files. For example:

cd /some/directory
wget https://bloomberg.bintray.com/BLPAPI-Experimental-Generic/blpapi_cpp_3.8.1.1-darwin.tar.gz
tar zxvf blpapi_cpp_3.8.1.1-darwin.tar.gz

export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/Darwin

export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1

Then you can proceed with installing the python library.