Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
KeyError on pipeline tutorial lesson 5

Hi,

I am getting the following error trying to execute Pipeline Tutorial Lesson 5.
Please let me know if there is a workaround.

Thanks,
Soumyajit.

result = run_pipeline(make_pipeline(), '2015-05-05', '2015-05-05')
result

Error:


KeyError Traceback (most recent call last)
in ()
----> 1 result = run_pipeline(make_pipeline(), '2015-05-05', '2015-05-05')
2 result

/build/src/extensions/extensions/main.py in run_pipeline(pipeline, start_date, end_date) 396 start_date=adjust_date,
397 end_date=adjust_date,
--> 398 )
399 def run_pipeline(pipeline, start_date, end_date):
400 """

/build/src/extensions/extensions/main.py in run_pipeline(pipeline, start_date, end_date) 404 PipelineEngine.run_pipeline.
405 """
--> 406 return engine.run_pipeline(pipeline, start_date, end_date)
407 return run_pipeline
408

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in run_pipeline(self, pipeline, start_date, end_date) 171 dates,
172 assets,
--> 173 initial_workspace={self._root_mask_term: root_mask_values},
174 )
175

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in compute_chunk(self, graph, dates, assets, initial_workspace) 352 loader = get_loader(term)
353 loaded = loader.load_adjusted_array(
--> 354 to_load, mask_dates, assets, mask,
355 )
356 workspace.update(loaded)

/build/src/qexec_repo/zipline_repo/zipline/pipeline/loaders/equity_pricing_loader.pyc in load_adjusted_array(self, columns, dates, assets, mask) 75 start_date,
76 end_date,
---> 77 assets,
78 )
79 adjustments = self.adjustments_loader.load_adjustments(

/build/src/qexec_repo/qexec/sources/resource_proxy.pyc in method(self, args, **kwargs) 134 def method(self, *args, **kwargs):
135 with self.resource as proxied:
--> 136 return getattr(proxied, name)(
args, **kwargs)
137 return method
138

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in load_raw_arrays(self, columns, start_date, end_date, assets) 560 def load_raw_arrays(self, columns, start_date, end_date, assets):
561 # Assumes that the given dates are actually in calendar.
--> 562 start_idx = self._calendar.get_loc(start_date)
563 end_idx = self._calendar.get_loc(end_date)
564 first_rows, last_rows, offsets = self._compute_slices(

/build/src/qexec_repo/zipline_repo/zipline/utils/memoize.pyc in get(self, instance, owner) 51 return self._cache[instance]
52 except KeyError:
---> 53 self._cache[instance] = val = self._get(instance)
54 return val
55

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in calendar(self) 472 @lazyval
473 def _calendar(self):
--> 474 return DatetimeIndex(self.
table.attrs['calendar'], tz='UTC')
475
476 @lazyval

/usr/local/lib/python2.7/dist-packages/bcolz/attrs.pyc in getitem(self, name) 93
94 def getitem(self, name):
---> 95 return self.attrs[name]
96
97 def setitem(self, name, obj):

KeyError: 'calendar'

9 responses

Hi All,

Likewise, error on all tutorials and notebooks that i've got.
Thank god its not only me.

this is from tutorial 3

KeyError Traceback (most recent call last)
in ()
----> 1 result = run_pipeline(make_pipeline(), '2015-05-05', '2015-05-05')
2 result

/build/src/extensions/extensions/main.py in run_pipeline(pipeline, start_date, end_date) 396 start_date=adjust_date,
397 end_date=adjust_date,
--> 398 )
399 def run_pipeline(pipeline, start_date, end_date):
400 """

/build/src/extensions/extensions/main.py in run_pipeline(pipeline, start_date, end_date) 404 PipelineEngine.run_pipeline.
405 """
--> 406 return engine.run_pipeline(pipeline, start_date, end_date)
407 return run_pipeline
408

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in run_pipeline(self, pipeline, start_date, end_date) 171 dates,
172 assets,
--> 173 initial_workspace={self._root_mask_term: root_mask_values},
174 )
175

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in compute_chunk(self, graph, dates, assets, initial_workspace) 352 loader = get_loader(term)
353 loaded = loader.load_adjusted_array(
--> 354 to_load, mask_dates, assets, mask,
355 )
356 workspace.update(loaded)

/build/src/qexec_repo/zipline_repo/zipline/pipeline/loaders/equity_pricing_loader.pyc in load_adjusted_array(self, columns, dates, assets, mask) 75 start_date,
76 end_date,
---> 77 assets,
78 )
79 adjustments = self.adjustments_loader.load_adjustments(

/build/src/qexec_repo/qexec/sources/resource_proxy.pyc in method(self, args, **kwargs) 134 def method(self, *args, **kwargs):
135 with self.resource as proxied:
--> 136 return getattr(proxied, name)(
args, **kwargs)
137 return method
138

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in load_raw_arrays(self, columns, start_date, end_date, assets) 560 def load_raw_arrays(self, columns, start_date, end_date, assets):
561 # Assumes that the given dates are actually in calendar.
--> 562 start_idx = self._calendar.get_loc(start_date)
563 end_idx = self._calendar.get_loc(end_date)
564 first_rows, last_rows, offsets = self._compute_slices(

/build/src/qexec_repo/zipline_repo/zipline/utils/memoize.pyc in get(self, instance, owner) 51 return self._cache[instance]
52 except KeyError:
---> 53 self._cache[instance] = val = self._get(instance)
54 return val
55

/build/src/qexec_repo/zipline_repo/zipline/data/us_equity_pricing.pyc in calendar(self) 472 @lazyval
473 def _calendar(self):
--> 474 return DatetimeIndex(self.
table.attrs['calendar'], tz='UTC')
475
476 @lazyval

/usr/local/lib/python2.7/dist-packages/bcolz/attrs.pyc in getitem(self, name) 93
94 def getitem(self, name):
---> 95 return self.attrs[name]
96
97 def setitem(self, name, obj):

KeyError: 'calendar'

Here too, I'm getting the same error on my pipeline. It used to work previously. Could be caused by new code that Quantopian introduced.

Me too. I guess it's a recent bug or something.

Hey guys,

We're looking into it, thank you for reporting the issue.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

The issue has been fixed, you should now be able to run the notebooks all the way through. Sorry for the inconvenience.

Hi Jamie,

Sorry, I am still having the same error. It happens after I run "zipline ingest" to load in the bundles, and downgrade pandas from 0.18.1 to 0.17.1 (zipline is complaining about the lates pandas).

Can anyone confirm if the example is running?

BTW, I haven't yet got any of the example from the tutoral link run successfully (http://www.zipline.io/beginner-tutorial.html#command-line-interface). In the first example, I am having the problem about "--symbols" parameter not recognised, and now the second example I have got three error in straight (data bundles, incompatable with pandas 0.18, now calendar...). Is it only me having this problem?
I simpley want a very very simple example to confirm zipline actually works on my machine...

Kind regards,
Steven

I'm hitting the same issue as well... zipline was installed via pip install zipline, so maybe the PyPi package needs updating?

I am getting the same error after installing via pip install zipline. Has anyone resolved this?

@Steven, @william, @Adam: The author of this thread was referring to a problem they had in the Pipeline Tutorial. The best place to report Zipline issues, including issues with the tutorial, is on the Zipline Issues page. I'd recommend also sifting through open issues to see if the problem that you're having has already been reported. In particular, it looks like this issue might be relevant.