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

2

5

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?

Stigmatize answered 6/9, 2016 at 21:52 Comment(0)
G
5

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.

Gemeinschaft answered 14/10, 2016 at 17:36 Comment(3)
Thanks for your answer. I am stuck at following blpapi/internals_wrap.cxx:3105:10: fatal error: 'blpapi_types.h' file not found #include "blpapi_types.h" ^ 1 error generated. error: command 'gcc' failed with exit status 1Decrescendo
Sorry for the trouble. You answer is almost correct. For export variable, it works finde - if you just write it as export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1Decrescendo
Confirmed that you must export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1Etruscan
D
5

Just to complete the question (thanks mob :)

Packages Source - https://www.bloomberglabs.com/api/libraries/

Preparation

  1. SDK for C/C++
  2. SDK for Python

Instructions

# navigate yourself to the path where you want to keep your SDK for some tim
cd /Users/msam/

# unzip C/C++ Package
tar zxvf Downloads/blpapi_cpp_3.8.1.1-darwin.tar.gz

# set variable
export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/
export DYLD_LIBRARY_PATH=/Users/sampathkumarm/blpapi_cpp_3.8.1.1/Darwin/

# save variable to reuse in next session
echo >> ~/.bash_profile
echo "Bloomberg API (python)library Settings " >> ~/.bash_profile
echo "export BLPAPI_ROOT=/some/directory/blpapi_cpp_3.8.1.1/" >> ~/.bash_profile
echo "export DYLD_LIBRARY_PATH=/Users/sampathkumarm/blpapi_cpp_3.8.1.1/Darwin/"  >> ~/.bash_profile
echo >> ~/.bash_profile

Ref: 1. python blpapi installation error

Decrescendo answered 3/11, 2016 at 3:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.