matthewgilbert / pdblp

pandas wrapper for Bloomberg Open API
MIT License
240 stars 69 forks source link

Cannot establish connection to Bloomberg API #55

Closed hodumAL closed 5 years ago

hodumAL commented 5 years ago

Code Sample, a copy-pastable example if possible

import pdblp
con = pdblp.BCon(debug=False, port=8194)
con.start()

Problem description

pdblp.pdblp:WARNING:Message Received: SessionStartupFailure = { reason = { source = "Session" category = "IO_ERROR" errorCode = 9 description = "Connection failed" } }

Expected Output

Want to be able to just get historical data, time series data etc. but first trying to establish connection.

Version Information

I am using desktop version of the API, and have bloomberg terminal on my desktop. Any help would be appreciated

matthewgilbert commented 5 years ago

Have you logged into the terminal? If so and it is still not working you may need to start the COM, e.g.

start C:\blp\DAPI\bbcomm.exe

Note that the location of bbcomm.exe may be different on your machine.

hodumAL commented 5 years ago

I am using bloomberg anywhere would this change anything? The terminal is up and running and I can search through it and everything but when I started it I did not see the bbcomm.exe executable file. Only citrix

matthewgilbert commented 5 years ago

I believe you need to install the actual terminal, available from https://www.bloomberg.com/professional/support/software-updates/, to get access to the API. I am unsure about this, but do not think you can use it via Bloomberg Anywhere.

That being said, you could get a definitive answer from Bloomberg help via HELP HELP in the terminal. They won't give you support for getting pdblp working but can advise on why your connection with blpapi (their package) cannot connect, but I suspect it has to do with Bloomberg Anywhere.

hodumAL commented 5 years ago

Thank you matt - I did need to install the terminal. Also, a note for future issues there was an incompatibility issue in terms of the C++ sdk and python sdk mismatch. The files folder C:\blp\DAPI blpapi3_3_32.dll and blpapi3_64.dll files need to make sure the versions on C++ match the supported python sdk. I used python 3.7 and C++ experimental release (v3.12.3.1)

matthewgilbert commented 5 years ago

Great glad to hear you resolved the issue. Yes I've come across this before and it can be annoying, particularly because the (presumably stable but not labelled) Python API hosted at https://www.bloomberg.com/professional/support/api-library/ is only compatible with the experimental C/C++ SDK. I believe they provide compatible versions if you instead download them from WAPI within the terminal, however this is one reason to not worry about it and just use the conda package for managing blpapi and pdblp available on conda-forge, e.g.

conda install -c conda-forge pdblp