Instead of "from feynman import *", try "attach feynman.sage" - my guess is that if you use the from ... import syntax then the .sage file is treated like a .py file rather than sage code.