matthewgilbert / pdblp

pandas wrapper for Bloomberg Open API
MIT License
242 stars 67 forks source link

raise ConnectionError("Could not start a blpapi.session") #21

Closed MilenkoMarkovic closed 6 years ago

MilenkoMarkovic commented 6 years ago

I have installed pdblp pip install -e pdblp I am on Ubuntu 16.04 My code

import pdblp
con = pdblp.BCon(debug=True, port=8194)
con.start()
con.bdh('SPY US Equity', 'PX_LAST','20150629', '20150630')

I got

python t15.py

08JAN2018_11:28:53.155 12856:140190920144640 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{1}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_11:28:53.155 12856:140190920144640 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{1} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
INFO:root:Failed to start session. Traceback (most recent call last): File "t15.py", line 4, in con.start() File "/home/milenko/pdblp/pdblp/pdblp.py", line 81, in start raise ConnectionError("Could not start a blpapi.session") ConnectionError: Could not start a blpapi.session

Why?

MilenkoMarkovic commented 6 years ago

If I go for ~/pdblp/doc$ make html I got sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v1.6.5 making output directory... loading pickled environment... not yet created building [mo]: targets for 0 po files that are out of date building [html]: targets for 3 source files that are out of date updating environment: 3 added, 0 changed, 0 removed reading sources... [100%] tutorial
08JAN2018_12:31:41.177 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{1}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.177 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{1} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.282 15332:139918967785216 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{2}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.282 15332:139918967785216 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{2} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.331 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{3}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.331 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{3} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.339 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{4}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.339 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{4} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.346 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{5}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.346 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{5} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.357 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{6}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.357 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{6} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.364 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{7}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.364 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{7} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

08JAN2018_12:31:41.372 15332:139918977754880 WARN blpapi_platformtransporttcp.cpp:137 blpapi.session.transporttcp.{8}. 127.0.0.1:8194, session pool state=Failed

08JAN2018_12:31:41.372 15332:139918977754880 WARN blpapi_platformcontroller.cpp:508 blpapi.session.platformcontroller.{8} Platform failed 1 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
Failed to start session.

/home/milenko/pdblp/doc/api.rst:30: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.debug' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.bdh' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.bdib' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.bsrch' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.ref' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.ref_hist' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.restart' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.start' /home/milenko/pdblp/doc/api.rst:37: WARNING: toctree references unknown document 'pdblp.pdblp.BCon.stop' /home/milenko/pdblp/pdblp/pdblp.py:docstring of pdblp.pdblp.BCon.bdib:0: WARNING: Block quote ends without a blank line; unexpected unindent. looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] tutorial

:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.debug' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdh' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdib' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bsrch' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref_hist' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.restart' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.start' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.stop' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.debug' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdh' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdib' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bsrch' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref_hist' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.restart' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.start' :: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.stop' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.debug' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdh' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bdib' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.bsrch' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.ref_hist' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.restart' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.start' /home/milenko/pdblp/doc/index.rst:: WARNING: toctree contains reference to nonexisting document 'pdblp.pdblp.BCon.stop' generating indices... writing additional pages... search copying static files... WARNING: html_static_path entry '/home/milenko/pdblp/doc/_static' does not exist done copying extra files... done dumping search index in English (code: en) ... done dumping object inventory... done build succeeded, 38 warnings.
matthewgilbert commented 6 years ago

This library is a wrapper on top of the python bloomberg API, blpapi which handles the communication with the Bloomberg Service. This error is telling you that you cannot connect to the Bloomberg Service. You will need to make sure you are running a Bloomberg Professional Terminal on the machine you are attempting to connect from. This should also work with B-PIPE although I have not tested this.

MilenkoMarkovic commented 6 years ago

How to install Bloomberg Professional Terminal?

On 8 January 2018 at 16:04, Matthew Gilbert notifications@github.com wrote:

This library is a wrapper on top of the python bloomberg API, blpapi which handles the communication with the Bloomberg Service. This error is telling you that you cannot connect to the Bloomberg Service. You will need to make sure you are running a Bloomberg Professional Terminal on the machine you are attempting to connect from. This should also work with B-PIPE although I have not tested this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matthewgilbert/pdblp/issues/21#issuecomment-355990903, or mute the thread https://github.com/notifications/unsubscribe-auth/AM1x-OO1lBEzNxbWeEr7HIcm0Mso2JNIks5tIi6QgaJpZM4RWLuN .

matthewgilbert commented 6 years ago

The Bloomberg Terminal is not a free service, but discussions on purchasing and licensing can be found at https://www.bloomberg.com/professional/solution/bloomberg-terminal/. This is somewhat beyond the scope of this package though.

MilenkoMarkovic commented 6 years ago

Ok,thanks.My goal was to download share histories of certain companies.

On 8 January 2018 at 18:55, Matthew Gilbert notifications@github.com wrote:

The Bloomberg Terminal is not a free service, but discussions on purchasing and licensing can be found at https://www.bloomberg.com/ professional/solution/bloomberg-terminal/. This is somewhat beyond the scope of this package though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matthewgilbert/pdblp/issues/21#issuecomment-356042749, or mute the thread https://github.com/notifications/unsubscribe-auth/AM1x-IjwnsrEX3Mz6JJkpy42lM2zF349ks5tIlacgaJpZM4RWLuN .

matthewgilbert commented 6 years ago

I would take a look at pandas-datareder which has some functionality around interfacing with free data sources.

MilenkoMarkovic commented 6 years ago

ok,thanks.

On 8 January 2018 at 19:14, Matthew Gilbert notifications@github.com wrote:

I would take a look at pandas-datareder https://github.com/pydata/pandas-datareader which has some functionality around interfacing with free data sources.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matthewgilbert/pdblp/issues/21#issuecomment-356047920, or mute the thread https://github.com/notifications/unsubscribe-auth/AM1x-L6AGYy--2goJAyLj2168AdOiQ25ks5tIlrqgaJpZM4RWLuN .