0

My Python version is 2.7.3 and OS is Windows 7.

I want to use the Bloomberg API libraries. Specifically, 'importing error blpapi' is my most problem.

At this site, I've tried to run both Supported Release(v3.5.5) and Experimental Release(v3.5.3). But both are not work.

Writing import blpapi in IDLE, I keep getting an following error message:

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

How can I solve this problem? (I hope to import 'blpapi')

icktoofay
  • 126,289
  • 21
  • 250
  • 231
user3685918
  • 335
  • 2
  • 12

1 Answers1

4

With reference to this: 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"

Community
  • 1
  • 1
lakshmen
  • 28,346
  • 66
  • 178
  • 276
  • Thank you. I've finished download and installation, but i can't find 'blpapi3_32.dll' file. – user3685918 Dec 19 '14 at 05:22
  • No, just created a 'blpapi-3.5.5' folder and it include 2 subfolders('blpapi','examples') there's no blpapi3_32.dll. Specific contain files are same as 'v3.5.5 (zip)' at above Bloombger website. – user3685918 Dec 19 '14 at 06:56
  • Just to add: this works also for the latest blpapi v3.9 version. – WillZ Nov 11 '15 at 11:11
  • Was getting the same issue on a new machine deployment and couldn't get the steps above to work - only to realise the Bloomberg terminal version hadn't been updated for a few years, a Bloomberg update fixed it. – alex314159 Dec 07 '15 at 20:31