How can I use ray cast volume rendering customizing my own shader?

In python you may have to explicitly import like this:

from vtkmodules.vtkRenderingVolumeOpenGL2 import vtkOpenGLGPUVolumeRayCastMapper

Also I think AddShaderReplacement(..) has to be called on the volumeprops and not the mapper itself.