I've installed python 3.9 venv and install blpapi
via:
pip install --index-url=https://bcms.bloomberg.com/pip/simple blpapi
(source)
When I run the following example on this venv I'm getting connection issues:
import blpapi
options = blpapi.SessionOptions()
options.setServerHost('localhost')
options.setServerPort(8194)
session = blpapi.Session(options)
session.start()
Error:
apicm_apiconnector.cpp:389 ApiConnector::socketConnectorCallback localhost: Failed to connect to 127.0.0.1:8194, status=1, error 8 connect event failed
ERROR blpapi_sessionimpl.cpp:2541 blpapi.session.{1} Failed to start session. { ErrorInfo=[ source = "ApiConnector" code = 8 category = "IO_ERROR" errorMessage = "connect event failed" subcategory = NULL ] RequestId=NULL }
The weird issue is when I install the same package on to the local python interpreter it works. Local python is python 3.10 and is able to connect.
Any ideas if I'm missing any critical steps in my installation of the package?
I tried to install it in to a separate local python environment and it works.
So I just had to restart my server...
When it doubt, restart....