AttributeError: module 'blpapi' has no attribute " /> AttributeError: module 'blpapi' has no attribute " /> AttributeError: module 'blpapi' has no attribute "/>

How do I download the "blpapi" Python library to use it with Bloomberg?

1k views Asked by At

I attempted to use the query "from xbbg import blp," but encountered the following error message: -> AttributeError: module 'blpapi' has no attribute 'session' (refer to the image below).

In my attempts to resolve this issue, I undertook the following steps:

  1. I tried installing the "blpapi" Python library in my Anaconda environment using the commands pip install blpapi and conda -c conda-forge blpapi. However, this approach failed due to a network blockage preventing the download of external sites.
  2. I installed "blpapipd" and "blpapi-stubs," both of which offer some similar functions. Unfortunately, even with these installations, the 'blp' import still did not function.
  3. I downloaded the blpapi package directly from the official Bloomberg site and placed the folder in /anaconda3/site-packages/folderX. Regrettably, this did not resolve the problem.

If anyone has a small idea about how to resolve this issue, I open to suggestions.

Thanks.

You can see the image, it shows the error. enter image description here

1

There are 1 answers

2
Beast Legend Tank On

You can't pip install blpapi.

pip uninstall blpapi

Then run install via pip using

python -m pip install --index-url=https://bcms.bloomberg.com/pip/simple blpapi

That's the proper way to install blpapi. You can then use xbbg as expected.