I am trying to pickle a namedtuple:
namedtuple
from collections import namedtuple import cPickle class Foo: Bar = namedtuple(\'Bar\', [\'x\', \'y\'])
The solution here is to move your named tuple definition to the module level, then pickle works. A detailed answer is provided here:
How to pickle a namedtuple instance correctly