I have a python script which is invoked inside a C++ application. When I import matplotlib I get the following error.
List index out of range.
In my script the only matplotlib
related code is
import matplotlib.pyplot as plt
f = plt.figure()
When I invoke the script on its own it works. I get this exception only when it is embedded in a C++ Program. Do I need to provide some extra dependencies when the script uses matplotlib?
When I comment out the matplotlib
functions I don't get the exception
Update
The C++ Code is from the python docs link : 1.3. Pure Embedding
I haven't modified anything from the C++ code. It works as long as there are no matplotlib related code.