这是我的第一篇文章。我运行以下代码: Win 10 Anaconda with Python 3.6.5 Bloomberg Anywhere
我正在尝试使用Python的blpapi (彭博社专业应用程序接口)。已下载Desktop API包(带有C++库),下载了blpapi-3.9.1-cp36-cp36m-win_amd64.whl安装程序文件并成功运行。最后,我在用户和环境变量(来自前面在stackoverflow上的查询)中将C:\..\C++API\v3.11.6.1\bin添加到我的路径中:Python 2.7 with Bloomberg API import blpapi failure
我在运行import blpapi时的错误消息:
>---------------------------------------------------------------------------
>ImportError Traceback (most recent call last)
>~\Anaconda3\lib\site-packages\blpapi\internals.py in swig_import_helper()
> 38 try:
>---> 39 return importlib.import_module(mname)
> 40 except ImportError:
>
>~\Anaconda3\lib\importlib\__init__.py in import_module(name, package)
> 125 level += 1
>--> 126 return _bootstrap._gcd_import(name[level:], package, level)
> 127 >>
>
>~\Anaconda3\lib\importlib\_bootstrap.py in _gcd_import(name, package, level)
>
>~\Anaconda3\lib\importlib\_bootstrap.py in _find_and_load(name, import_)
>
>~\Anaconda3\lib\importlib\_bootstrap.py in _find_and_load_unlocked(name, >import_)
>
>~\Anaconda3\lib\importlib\_bootstrap.py in _load_unlocked(spec)
>
>~\Anaconda3\lib\importlib\_bootstrap.py in module_from_spec(spec)
>
>~\Anaconda3\lib\importlib\_bootstrap_external.py in create_module(self, spec)
>
>~\Anaconda3\lib\importlib\_bootstrap.py in _call_with_frames_removed(f, *args, >**kwds)
>
>ImportError: DLL load failed: The specified module could not be found.
>
>During handling of the above exception, another exception occurred:
>
>ModuleNotFoundError Traceback (most recent call last)
>~\Anaconda3\lib\site-packages\blpapi\__init__.py in <module>()
> 3 try:
>----> 4 from .internals import CorrelationId
> 5 except ImportError as error:
>
>~\Anaconda3\lib\site-packages\blpapi\internals.py in <module>()
> 41 return importlib.import_module('_internals')
>---> 42 _internals = swig_import_helper()
> 43 del swig_import_helper
>
>~\Anaconda3\lib\site-packages\blpapi\internals.py in swig_import_helper()
> 40 except ImportError:
>---> 41 return importlib.import_module('_internals')
> 42 _internals = swig_import_helper()
>
>~\Anaconda3\lib\importlib\__init__.py in import_module(name, package)
> 125 level += 1
>--> 126 return _bootstrap._gcd_import(name[level:], package, level)
> 127
>
>ModuleNotFoundError: No module named '_internals'
>
>During handling of the above exception, another exception occurred:
>
>ImportError Traceback (most recent call last)
><ipython-input-1-ee203a799ece> in <module>()
>----> 1 import blpapi
>
>~\Anaconda3\lib\site-packages\blpapi\__init__.py in <module>()
> 27
> 28 """ % (str(error), env)
>---> 29 raise ImportError(msg)
> 30
> 31 from .abstractsession import AbstractSession
>
>ImportError: No module named '_internals'
>
>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 PATH before entering the interpreter.有人知道问题出在哪里吗?
发布于 2020-06-05 20:24:58
有着完全相同的问题。可比性问题。
对我来说,解决方案是将python版本回滚到3.7.7 64位
from: 3.8.3 32-bit
to: 3.7.7 64-bit如果版本是兼容的,那么BLPAPI就可以工作,否则就会失败。
Bloomberg dll文件:
blpapi3_32.dll (version 3.14.3.1)
blpapi3_64.dll (version 3.14.3.1)这就解决了问题。
发布于 2018-07-11 05:35:20
解决方案:我安装了微软构建工具2017,并添加了BLPAPI_ROOT路径,如我最初帖子中链接的问题所述。
https://stackoverflow.com/questions/51271726
复制相似问题