1

I am trying to import the bbg package from the tia library in python. But it gives me the following error.

ImportError: DLL load failed: The specified module could not be found.

I also tried importing blpapi lib but it gives the same error as well. I dont understand what is the problem.

When I got to the folder on my desktop to see where the packages are, I see the files are present for both tia as well as blpapi.

import blpapi
import tia
Traceback (most recent call last):

  File "<ipython-input-1-fc04960a7441>", line 1, in <module>
    import blpapi

  File "C:\Program Files\Anaconda\lib\site-packages\blpapi\__init__.py", line 5, in <module>
    from .internals import CorrelationId

  File "C:\Program Files\Anaconda\lib\site-packages\blpapi\internals.py", line 52, in <module>
    _internals = swig_import_helper()

  File "C:\Program Files\Anaconda\lib\site-packages\blpapi\internals.py", line 48, in swig_import_helper
    _mod = imp.load_module('_internals', fp, pathname, description)

  File "C:\Program Files\Anaconda\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)

  File "C:\Program Files\Anaconda\lib\imp.py", line 343, in load_dynamic
    return _load(spec)

ImportError: DLL load failed: The specified module could not be found.
Roope
  • 4,469
  • 2
  • 27
  • 51

4 Answers4

0

Some of the dlls come from the C++ library I believe, so you have to download both:

https://www.bloomberg.com/professional/support/api-library/

0

You'll probably need to add the C++ lib folder into your PATH environment variable.

Kevin Liu
  • 667
  • 5
  • 14
0

I was getting a similar error and had to downgrade my Python 3.7 to 3.6 and use the experimental C++ SDK release from the bloomberg API download site, once that was complete the API was working fine.

0

If the issue is dll-related, you can manually try to copy the .dll files in C++API\lib (blpapi3_32.dll and blpapi3_64.dll in my case) into C:\windows\system32 where all the dll files that system uses.

Also, I copied the dll files in in C++API\lib into C:\blp\DAPI, replacing the new ones with the old ones to make sure I have the same dll files everywhere.

Somehow, Path variable wasn't successful enough to find the dlls in the API folder.

Cagri
  • 307
  • 3
  • 13