# Keli's Mumbo Jumbo

Small aim is a crime, have great aim.

0%

To install blpapi library for python on Mac OS, first download the C++ sdk from bloomberg.

Then unpack the tarball to a path you prefer. Take /usr/local for example:

Next, try installing blpapi for python with pip, with env variable BLPAPI_ROOT pointing to the C++ sdk's path.

If you have the lastest xcode CLT installed, you might see a compiler error though:

In this case, you have to fix the error first, goto bintray and download the python source tarball, then unpack it.

A quick search in the C++ sdk shows that the header file that defines the function in question is not included, just open blpapi/internals_wrap.c in the python source directory and add a line to include the header file will fix the error.

Then proceed to install:

That should be it! For much older versions I had to modify the generated _internal.so using install_name_tool -change to help locate libblpapi3.so, which was not as pleasant an experience. Fortunately the newer versions have fixed the issue. It's worth mentioning that the installation on Linux is basically the same, with only one additional step to help locate libblpapi3.so, either by copying the file to /lib/ or add the path of C++ sdk to ld.so.conf.

Hope this helps.