With the import command you use, you can access all.Matrix. Alternatively, you can use from sage.all import * and then Matrix should just work. For true cython work, you probably want to use a cimport. You cannot use sage.all for such imports, so you might as well start using more specific imports right away if real cython use is your goal.