answered 2 years ago
The post named "sympy codegen with indices" in this forum pointed me to the solution.
I just need to include the following: from sympy.utilities.codegen import codegen