Hi, so I could see two answers to your question. Could you clarify which one you are interested in discussing further?
(1) if your question is about how to use DMRGpy (i.e. regarding the error you got), you should contact the maintainer or DMRGpy, Jose Lado. Another Python package for DMRG is TeNPy which you might want to try if you are staying with Python.
(2) if you are willing to learn Julia, which is not too hard to learn especially if you start from example codes for DMRG and correlation functions which we provide in the ITensor documentation, then you could certainly use ITensor to compute spin correlation functions of the Heisenberg model.
For the case of (2), please see the following examples of how to do (a) DMRG of the Heisenberg model and (b) compute a spin correlation function using the ITensor function called correlation_matrix
(a) https://itensor.github.io/ITensors.jl/stable/tutorials/DMRG.html
(b) https://itensor.github.io/ITensors.jl/stable/examples/MPSandMPO.html#Computing-Correlation-Functions