2014-12-19 62 views
0

我的Python版本是2.7.3,操作系統是Windows 7.Python Bloomberg API('DLL load failed')

我想使用彭博API API庫。具體來說,「導入錯誤blpapi」是我最大的問題。

this site, 我試着運行支持版本(v3.5.5)和實驗版本(v3.5.3)。 但兩者都不起作用。

寫作IDLE import blpapi, 我不斷收到以下錯誤信息:

Traceback (most recent call last):

File <pyshell#0> , line 1, in <module>

import blpapi 

File C:\Python27\lib\site-packages\blpapi\__init__.py , line 5, in <module>

from .internals import CorrelationId 

File C:\Python27\lib\site-packages\blpapi\internals.py , line 50, in <module>

_internals = swig_import_helper() 

File C:\Python27\lib\site-packages\blpapi\internals.py , line 46, in swig_import_helper

_mod = imp.load_module('_internals', fp, pathname, description) 

ImportError: dll load failed specified module could not found

我怎樣才能解決這個問題? (我希望導入 'blpapi')

+0

具有u安裝v3.5.5(ZIP)從Bloomberg網站? – lakesh 2014-12-19 05:03:35

+0

是的,我做到了。而bloomberg圖書館安裝在我的site-packages文件夾中。 – user3685918 2014-12-19 05:07:26

回答

3

參照這樣的:Python 2.7 with Bloomberg API import blpapi failure

The ImportError is the result of Bloomberg not being able to find the "blpapi3_32.dll" DLL file. This DLL file can be located under the \bin or \lib folder of Bloomberg's C/C++ library, which is at the same location where you got your Python executable. So go download that library (v3.7.5.1 as of this writing), and have your system's "Path" environment variable include that location. This should resolve the issue.

PS you can access the PATH variable via Start > right-clicking "Computer" > Properties > Advanced System Settings > Advanced (tab) > Environment Variables > look for the "Path" variable under "System variables". Edit this variable to include the location of the DLL file, e.g. if the original Path variable is "C:\Python27\Lib\site-packages\PyQt4", then new Path variable should be "C:\Python27\Lib\site-packages\PyQt4;C:\blp\API\blpapi_cpp_3.7.5.1\bin"

+0

謝謝。我已完成下載和安裝,但我找不到'blpapi3_32.dll'文件。 – user3685918 2014-12-19 05:22:59

+0

它有沒有/ – lakesh 2014-12-19 06:08:11

+0

你是否找到了? – lakesh 2014-12-19 06:51:57