finmarketpy icon indicating copy to clipboard operation
finmarketpy copied to clipboard

error when calling LightTimeSeriesFactor with Bloomberg

Open toimfortes opened this issue 8 years ago • 3 comments

df = ltsf.harvest_time_series(time_series_request) Traceback (most recent call last): File "", line 1, in File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lighttimeseriesfactory.py", line 126, in harvest_time_series loader = self.get_loader(time_series_request.data_source) File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lighttimeseriesfactory.py", line 93, in get_loader loader = LoaderBBGOpen() File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lowlevel\bbg\loaderbbgopen.py", line 41, in init super(LoaderBBGOpen, self).init() TypeError: must be type, not classobj

toimfortes avatar Mar 31 '16 09:03 toimfortes

Hi @toimfortes, thanks for flagging this. First, I'd recommend downloading the newest dev version of PyThalesians from GitHub, as opposed to the last release (which is now quite old). Also, the library is built for Python 3, so it is unlikely to be compatible with Python 2 (I suspect this is the problem you are having looking at the code). Regards Saeed

saeedamen avatar Mar 31 '16 15:03 saeedamen

Hi, I am getting the same error, therefore I switched to Python3 however the Bloomberg Python SDK is not compatible with Python3.

#!/usr/bin/env python

"""
setup.py file for Bloomberg Python SDK
"""

from distutils.core import setup, Extension
import os
import platform as plat
from sys import version
from sys import platform

if version < '2.6':
    raise Exception(
        "Python versions before 2.6 are not supported (current version is " +
    version + ")")
if version >= '3.0':
    raise Exception(
        "Python 3 is not supported (current version is " + version +
        ")")

Regards, Robert

Heavy-Sauria avatar Apr 14 '16 23:04 Heavy-Sauria

Hi @csango - I think you have an old version of the Bloomberg Python API from the look of it. The newer versions are compatible with Python 3. You can download these from http://www.bloomberglabs.com/api/libraries/ - if you have Python 3.5, you'll need to compile it however (I've got a precompiled version though, if you have trouble :-). For all other Python versions, Bloomberg have provided easy to install binaries. Regards Saeed

saeedamen avatar Apr 15 '16 10:04 saeedamen