I'm trying to run the Bloomberg python API in a PC that have Windows 10 Pro v22H2. I'm using Python v3.8 and I have installed blpapi==2.30.1 and xbbg==0.7.7, also I'm running the code in the same PC where I'm logged in a bloomberg terminal (I have a bloomberg Anywhere license). I also verified that both blpapi3_32.dll
and blpapi3_64.dll
are present in C:\blp\DAPI
. When I try to run the following test code
from xbbg import blp
blp.bdp(tickers='NVDA US Equity', flds=['Security_Name', 'GICS_Sector_Name'])
it retrieves the following error
06JUN2023_17:00:33.679 15288:1696 WARN apicm_apiconnector.cpp:389 ApiConnector::socketConnectorCallback localhost: Failed to connect to 127.0.0.1:8194, status=1, error 8 connect event failed
06JUN2023_17:00:33.679 15288:1696 WARN blpapi_platformtransporttcp.cpp:136 blpapi.session.{1}.transporttcp<localhost:8194>{platformId=0} 127.0.0.1, session pool state=Failed
06JUN2023_17:00:38.689 15288:1696 WARN apicm_apiconnector.cpp:389 ApiConnector::socketConnectorCallback localhost: Failed to connect to 127.0.0.1:8194, status=1, error 8 connect event failed
06JUN2023_17:00:38.689 15288:1696 WARN blpapi_platformtransporttcp.cpp:136 blpapi.session.{1}.transporttcp<localhost:8194>{platformId=0} 127.0.0.1, session pool state=Failed
06JUN2023_17:00:43.714 15288:1696 WARN apicm_apiconnector.cpp:389 ApiConnector::socketConnectorCallback localhost: Failed to connect to 127.0.0.1:8194, status=1, error 8 connect event failed
06JUN2023_17:00:43.715 15288:1696 WARN blpapi_platformtransporttcp.cpp:136 blpapi.session.{1}.transporttcp<localhost:8194>{platformId=0} 127.0.0.1, session pool state=Failed
06JUN2023_17:00:43.715 15288:1696 WARN blpapi_platformcontroller.cpp:622 blpapi.session.{1}.platformcontroller Platform failed 3 consecutive connect attempts, stopped trying to reconnect. { PlatformId=0 }
06JUN2023_17:00:43.716 15288:19076 ERROR blpapi_sessionimpl.cpp:2506 blpapi.session.{1} Failed to start session. { ErrorInfo=[ source = "ApiConnector" code = 8 category = "IO_ERROR" errorMessage = "connect event failed" subcategory = NULL ] RequestId=NULL }
Traceback (most recent call last):
File "test_bbg.py", line 3, in <module>
blp.bdp(tickers='NVDA US Equity', flds=['Security_Name', 'GICS_Sector_Name'])
File "C:\Users\Asset\Documents\ca_front_repo\venv\lib\site-packages\xbbg\blp.py", line 47, in bdp
request = process.create_request(
File "C:\Users\Asset\Documents\ca_front_repo\venv\lib\site-packages\xbbg\core\process.py", line 46, in create_request
srv = conn.bbg_service(service=service, **kwargs)
File "C:\Users\Asset\Documents\ca_front_repo\venv\lib\site-packages\xbbg\core\conn.py", line 150, in bbg_service
bbg_session(**kwargs).openService(service)
File "C:\Users\Asset\Documents\ca_front_repo\venv\lib\site-packages\xbbg\core\conn.py", line 120, in bbg_session
globals()[con_sym] = connect_bbg(**kwargs)
File "C:\Users\Asset\Documents\ca_front_repo\venv\lib\site-packages\xbbg\core\conn.py", line 97, in connect_bbg
else: raise ConnectionError('Cannot connect to Bloomberg')
ConnectionError: Cannot connect to Bloomberg
I saw in some places that I should try to run BBComm manually to see if it connects, but when I try a receive the following error
Unable to lookup api directory, errorDesc=failed to read Path from BBComm registry
LOGFILE: C:\Users\Asset\AppData\Local\Temp\Bloomberg\Log\bbcomm.log
bbcomm.loadConfiguration: Unable to access key: SOFTWARE\Bloomberg L.P.\BBComm\Parameters
06JUN2023_22:11:33.302542 10924 7180 ERROR D:\dev\sotr_jaas\snap\tbbc\numbered\63\clientbuild\api_tbbc\src\bbcomm\m_bbcomm\m_bbcomm_util.cpp 666 UNINITIALIZED_LOGGER_MANAGER Unable to access HKEY_LOCAL_MACHINE key: SOFTWARE\Bloomberg L.P.\BBComm\Parameters
Bloomberg communication server started.
bbcomm Version 3.100.0.0 (3.100.0.0)
bbcomm.loadConfiguration: Unable to access key: SOFTWARE\Bloomberg L.P.\BBComm\Parameters
2023/06/06 19:11:33.304 [ERROR] bbcomm.loadRoutes: Unable to access HKEY_LOCAL_MACHINE key: SOFTWARE\Bloomberg L.P.\BBComm\Parameters
2023/06/06 19:11:33.318 [ERROR] BbcommUtil.queryGetNewCertValue: Unable to access HKEY_LOCAL_MACHINE key: SOFTWARE\Bloomberg L.P.\BBComm\Parameters
I also tried to run the API Diagnostic Tool, but it throws an error saying that it cannot find the blpapi3_64.dll
, but this file is at blp\DAPI
It seems that the program doesn't have access to HKEY_LOCAL_MACHINE
, but I'm not sure about that and if that is the case I don't how to fix it.