answered 2022-12-21 22:58:12 +0200
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