Trying to set up a PC with Bloomberg python API. I followed every step of the instruction but when i finally tried to "import blpapi", it always run into issues. Below is the log. Any help would be greatly appreciated.
I did the following steps already, after researching the issue for hours online:
- install latest c++ api into c:\blp\cppapi directory
- added c:\blp\cppapi\lib, c\blp\cppapi\bin, and c:\blp\cppapi to path
- set env BLPAPI_ROOT to c:\blp\cppapi
- I even reinstalled Bloomberg.
Still, i always got the same error. Looks like I just can't make python to get to the c++ API directory on the hard drive...
Thanks in advance!
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools>python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import blpapi
Traceback (most recent call last):
File "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\blpapi\internals.py", line 39, in swig_import_helper
return importlib.import_module(mname)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blpapi._internals'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\blpapi\__init__.py", line 6, in <module>
from .internals import CorrelationId
File "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\blpapi\internals.py", line 42, in <module>
_internals = swig_import_helper()
File "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\blpapi\internals.py", line 41, in swig_import_helper
return importlib.import_module('_internals')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_internals'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\blpapi\__init__.py", line 11, in <module>
raise debug_load_error(error)
ImportError:
---------------------------- ENVIRONMENT -----------------------------
Platform: Windows-10-10.0.18362-SP0
Architecture: ('64bit', 'WindowsPE')
Python: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
Python implementation: CPython
blpapi 64-bit will be loaded from: "C:\blp\cppapi\bin\blpapi3_64.dll"
blpapi 32-bit will be loaded from: "C:\blp\cppapi\bin\blpapi3_32.dll"
System PATH: (* marks locations where blpapi was found)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Roslyn"
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86"
"C:\Program Files (x86)\Windows Kits\10\bin\x86"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\\MSBuild\15.0\bin"
"C:\Windows\Microsoft.NET\Framework\v4.0.30319"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\"
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath"
"C:\WINDOWS\system32"
"C:\WINDOWS"
"C:\WINDOWS\System32\Wbem"
"C:\blp\cppapi"
* "C:\blp\cppapi\bin"
* "C:\blp\cppapi\lib"
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\"
"C:\WINDOWS\System32\OpenSSH\"
"C:\Program Files (x86)\AOMEI Backupper"
* "C:\blp\DAPI"
"C:\Users\frank\AppData\Local\Microsoft\WindowsApps"
"C:\blp\cppapi"
* "C:\blp\cppapi\bin"
* "C:\blp\cppapi\lib"
* "C:\blp\DAPI"
"C:\blp\DAPI\DDE"
"C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.1\bin"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja"
blpapi package at: "C:\Users\frank\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages"
Current directory: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
----------------------------------------------------------------------
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 PATH before entering the interpreter.
>>>