Reputation: 6949
I use matplotlib to create some charts, using the AGG
backend.
import matplotlib
matplotlib.use('AGG')
import matplotlib.plot as plt
# ...
def chart_view(request):
fig = plt.figure
# Do stuff with fig and finally save it in a Django HttpResponse
# object and return the HttpResponse object.
Now I have a web page that has three images, all three images resulting in running chart_view
. Only one image usually makes it, and the Django development server stops with "Fatal Python error: GC object already tracked". I'm not certain the problem is in matplotlib
, it could be in pandas
.
How can I debug the problem?
Upvotes: 0
Views: 2521
Reputation: 6949
OK, I found out that it's doing it when I use Debian Jessie's matplotlib 1.4.2 in combination with the latest pandas (0.17.0) that I have installed with pip install --upgrade --no-deps pandas
(in a virtualenv that uses --system-site-packages
). If I use Debian's pandas 0.14.1 everything's fine. Go figure why this is. Anyway, using Debian's packages is what I intended to do so this solves the problem for me.
Upvotes: 0