Colab new error 'EntryPoints' object has no attribute 'get'
-
I was running strategies from Colab whitout any problem but now I am getting this error even in the example form
- https://quantiacs.com/documentation/en/user_guide/local_development.html#google-colab-support
- https://quantiacs.com/documentation/en/_static/colab.ipynb
=================
import xarray as xr
import qnt.stats as qnstats
import qnt.data as qndata
import qnt.output as qnout
import qnt.ta as qnta
import qnt.backtester as qnbt
import qnt.graph as qngraphdef load_data(period):
return qndata.stocks.load_ndx_data(tail=period)def strategy(data):
close = data.sel(field="close")
is_liquid = data.sel(field="is_liquid")
sma_slow = qnta.sma(close, 200).isel(time=-1)
sma_fast = qnta.sma(close, 20).isel(time=-1)
weights = xr.where(sma_slow < sma_fast, 1, -1)
weights = weights * is_liquid
return weightsweights = qnbt.backtest(
competition_type = "stocks_nasdaq100",
load_data = load_data,
lookback_period = 365*4,
start_date = "2006-01-01",
strategy = strategy,
analyze = True,
build_plots = True
)===============
Run last pass...
Load data...AttributeError Traceback (most recent call last)
<ipython-input-5-ef8fa45745b7> in <module>
32 strategy = strategy,
33 analyze = True,
---> 34 build_plots = True
35 )9 frames
/usr/local/lib/python3.7/dist-packages/xarray/backends/plugins.py in list_engines()
103 @functools.lru_cache(maxsize=1)
104 def list_engines():
--> 105 entrypoints = entry_points().get("xarray.backends", ())
106 return build_engines(entrypoints)
107AttributeError: 'EntryPoints' object has no attribute 'get'
-
It seems that is a problem with the newer 0.20.2 version of xarray in Coab because I have the same problem running the Xarray Turorial from http://gallery.pangeo.io/repos/pangeo-data/pangeo-tutorial-gallery/xarray.html#Table-of-contents
I added to before any other cell
!pip uninstall xarray -y
!pip install xarray==0.19.0And is working now.
-
@gjhernandezp Thank you for sharing your solution!
-
This post is deleted! -
This post is deleted!