Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'ols' #14

Open
albanywang2016 opened this issue May 18, 2017 · 1 comment
Open

ImportError: cannot import name 'ols' #14

albanywang2016 opened this issue May 18, 2017 · 1 comment

Comments

@albanywang2016
Copy link

i got error "ImportError: cannot import name 'ols'"
what am i missing?

Traceback (most recent call last):
File "C:/Users/lei.wang/AppData/Local/Continuum/Anaconda3/Lib/site-packages/finmarketpy_examples/backtest_example.py", line 30, in
from finmarketpy.backtest import BacktestRequest, Backtest
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy_init_.py", line 1, in
from finmarketpy import (backtest, economics, util)
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy\backtest_init_.py", line 3, in
from finmarketpy.backtest.backtestengine import Backtest
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy\backtest\backtestengine.py", line 17, in
from findatapy.util import LoggerManager
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy_init_.py", line 3, in
from findatapy import (market, timeseries, util)
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\market_init_.py", line 8, in
from findatapy.market.market import Market, FXVolFactory, FXCrossFactory, FXConv
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\market\market.py", line 461, in
from findatapy.timeseries import Calculations, Filter, Timezone
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\timeseries_init_.py", line 6, in
from findatapy.timeseries.calculations import Calculations
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\timeseries\calculations.py", line 23, in
from pandas.stats.api import ols
ImportError: cannot import name 'ols'

@saeedamen
Copy link
Contributor

Hi @albanywang2016 - I think the ols package might be deprecated in newer versions of pandas (also I haven't tried the libraries in Python 3.6, I generally use 3.5). The nearest alternative is statsmodels which uses ols. As a temporary fix I've it to import the statsmodels OLS module, so it should at least run (but don't think the regression functions will work - need to rewrite my code to use statsmodels OLS). You'll need to update the findatapy library on your system. Hopefully it'll work, if not, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants