Bloomberg 的 blpapi python 中的 ImportError

ImportError in blpapi python for bloomberg

我正在尝试让 BLOOMBERG API 在 mac os mojave 10.14 上通过 Python 工作。

我的 mac

上有 python 2.7.10

我下载了 C/C++ SDK Experimental Release v3.13.1.1 我将内容解压到

\Users\hk\blpapi_cpp_3.13.1.1

我在.bash_profileBLPAPI_ROOT和DLYD_LIBRARYPATH中设置了环境变量为C/C++SDK路径

然后我按照本页底部所述通过 pip 安装了 Python API:API Library Support 并收到 成功安装消息。

使用 import blpapi 时出现以下错误:

File "blpapitest.py", line 5, in <module>
import blpapi
  File "/Library/Python/2.7/site-packages/blpapi/__init__.py", line 11, in <module>
    raise debug_load_error(error)
ImportError: No module named _versionhelper

Could not open the C++ SDK library.

Download and install the latest C++ SDK from:

    http://www.bloomberg.com/professional/api-library

If the C++ SDK is already installed, please ensure that the path to the library
was added to DYLD_LIBRARY_PATH before entering the interpreter.

我重新检查了环境变量DYLD_LIBRARY_PATH,它被设置为C/C++ SDK文件夹路径\Users\hk\blpapi_cpp_3.13.1.1

有什么解决办法吗?

您需要将 C++ "lib" 文件夹添加到您的库路径中:

\Users\hk\blpapi_cpp_3.13.1.1\lib