我正在运行64位的Miniconda 3.7。我已经通过运行命令> python -m pip install --index-url=https://bloomberg.bintray.com/pip/simple blpapi
成功安装了blpapi软件包。
我还从此处https://www.bloomberg.com/professional/support/api-library/下载了c ++ sdk,并将BLPAPI_ROOT环境变量设置为C:\Users\AlexF\Downloads\blpapi_cpp_3.8.18.1
。
该软件包安装正确,但是当我尝试运行import blpapi
时,出现以下错误:
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import blpapi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Miniconda3\lib\site-packages\blpapi\__init__.py", line 4, in <module>
from .internals import CorrelationId
File "C:\Miniconda3\lib\site-packages\blpapi\internals.py", line 844
def blpapi_EventDispatcher_stop(handle, async):
^
SyntaxError: invalid syntax
有人知道这是怎么回事吗?我已经尝试搜索此错误,但是找不到有关如何解决该错误的很多参考。