[Tutor] pdf generation problem

Alan Gauld alan.gauld at yahoo.co.uk
Fri Mar 3 20:21:40 EST 2017

On 04/03/17 00:28, Jason Snyder wrote:
> I have the following program where I am trying to generate a pdf:

>       6 from matplotlib.backends.backend_pdf import PdfPages
>       7 import numpy as np

>      13 with PdfPages('wx_plot.pdf') as pdf:

> When I run it I get the following error:
> Traceback (most recent call last):
>   File "testinger.py", line 13, in <module>
>     with PdfPages('wx_plot.pdf') as pdf:
> AttributeError: __exit__
> What is going on here and how do I resolve this issue?

I don't know, but it's not really a python language problem
more of a matplotlib/SciPy problem so you should probably
try asking first on the SciPy support forum.

We don't mind offering general help on third party
libraries but that looks like a very specific module

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list