{"action":"created","issue":{"url":"https://api.github.com/repos/quantopian/zipline/issues/650","labels_url":"https://api.github.com/repos/quantopian/zipline/issues/650/labels{/name}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/650/comments","events_url":"https://api.github.com/repos/quantopian/zipline/issues/650/events","html_url":"https://github.com/quantopian/zipline/issues/650","id":94982758,"number":650,"title":"Tutorial buyapple.py fails in python 2.7.10","user":{"login":"beebeed","id":3851636,"avatar_url":"https://avatars.githubusercontent.com/u/3851636?v=3","gravatar_id":"","url":"https://api.github.com/users/beebeed","html_url":"https://github.com/beebeed","followers_url":"https://api.github.com/users/beebeed/followers","following_url":"https://api.github.com/users/beebeed/following{/other_user}","gists_url":"https://api.github.com/users/beebeed/gists{/gist_id}","starred_url":"https://api.github.com/users/beebeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beebeed/subscriptions","organizations_url":"https://api.github.com/users/beebeed/orgs","repos_url":"https://api.github.com/users/beebeed/repos","events_url":"https://api.github.com/users/beebeed/events{/privacy}","received_events_url":"https://api.github.com/users/beebeed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jfkirk","id":10326791,"avatar_url":"https://avatars.githubusercontent.com/u/10326791?v=3","gravatar_id":"","url":"https://api.github.com/users/jfkirk","html_url":"https://github.com/jfkirk","followers_url":"https://api.github.com/users/jfkirk/followers","following_url":"https://api.github.com/users/jfkirk/following{/other_user}","gists_url":"https://api.github.com/users/jfkirk/gists{/gist_id}","starred_url":"https://api.github.com/users/jfkirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfkirk/subscriptions","organizations_url":"https://api.github.com/users/jfkirk/orgs","repos_url":"https://api.github.com/users/jfkirk/repos","events_url":"https://api.github.com/users/jfkirk/events{/privacy}","received_events_url":"https://api.github.com/users/jfkirk/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-07-14T16:22:00Z","updated_at":"2015-07-14T21:31:29Z","closed_at":null,"body":"running buyapple.py fails in python 2.7.10 but runs in python 3.4.3 for zipline 8.0rc. The part of code that fails is `data[symbol('AAPL')]` found in\r\n```\r\nrecord(AAPL=data[symbol('AAPL')].price)\r\n```\r\nthe error is\r\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\python2710_64\\Scripts\\run_algo.py\", line 4, in <module>\r\n    __import__('pkg_resources').run_script('zipline==0.8.0rc1', 'run_algo.py')\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\pkg_resources\\__init__.py\", line 729, in run_script\r\n    self.require(requires)[0].run_script(script_name, ns)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\pkg_resources\\__init__.py\", line 1642, in run_script\r\n    exec(code, namespace, namespace)\r\n  File \"c:\\python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\EGG-INFO\\scripts\\run_algo.py\", line 23, in <module>\r\n    run_pipeline(print_algo=True, **parsed)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\utils\\cli.py\", line 246, in run_pipeline\r\n    perf = algo.run(source, overwrite_sim_params=overwrite_sim_params)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\algorithm.py\", line 529, in run\r\n    for perf in self.gen:\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\gens\\tradesimulation.py\", line 120, in transform\r\n    self.algo.instant_fill,\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\gens\\tradesimulation.py\", line 314, in _process_snapshot\r\n    new_orders = self._call_handle_data()\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\gens\\tradesimulation.py\", line 343, in _call_handle_data\r\n    self.simulation_dt,\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\utils\\events.py\", line 194, in handle_data\r\n    event.handle_data(context, data, dt)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\utils\\events.py\", line 212, in handle_data\r\n    self.callback(context, data)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\algorithm.py\", line 306, in handle_data\r\n    self._handle_data(self, data)\r\n  File \"buyapple.py\", line 26, in handle_data\r\n    record(AAPL=data[symbol('AAPL')].price)\r\n  File \"C:\\Python2710_64\\lib\\site-packages\\zipline-0.8.0rc1-py2.7-win-amd64.egg\\zipline\\protocol.py\", line 518, in __getitem__\r\n    return self._data[name]\r\nKeyError: Equity(0, symbol='AAPL', asset_name='', exchange='', start_date=None, end_date=None, first_traded=None)\r\n```\r\n\r\nEnvironment: Windows 7 64 bit, Python 3.4, Python 2.7, zipline 0.8.0rc\r\nAppears to be with zipline.protocol.BarData and zipline.assets._assets.Equity\r\n\r\nKind regards\r\n\r\nDavid Bieber"},"comment":{"url":"https://api.github.com/repos/quantopian/zipline/issues/comments/121396733","html_url":"https://github.com/quantopian/zipline/issues/650#issuecomment-121396733","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/650","id":121396733,"user":{"login":"jfkirk","id":10326791,"avatar_url":"https://avatars.githubusercontent.com/u/10326791?v=3","gravatar_id":"","url":"https://api.github.com/users/jfkirk","html_url":"https://github.com/jfkirk","followers_url":"https://api.github.com/users/jfkirk/followers","following_url":"https://api.github.com/users/jfkirk/following{/other_user}","gists_url":"https://api.github.com/users/jfkirk/gists{/gist_id}","starred_url":"https://api.github.com/users/jfkirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfkirk/subscriptions","organizations_url":"https://api.github.com/users/jfkirk/orgs","repos_url":"https://api.github.com/users/jfkirk/repos","events_url":"https://api.github.com/users/jfkirk/events{/privacy}","received_events_url":"https://api.github.com/users/jfkirk/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T21:31:29Z","updated_at":"2015-07-14T21:31:29Z","body":"Ok - I'll look in to the dependency as well. I'll update once I've reproduced."}}