python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

AttributeError: 'Slides' object has no attribute 'slides'

Open razhakin opened this issue 3 years ago • 1 comments

Hi!

I've just started having an issue with the library when it comes to just accessing slides.

textbox = pres.slides[0].shapes.add_textbox(Cm(0), Cm(0), Cm(19.25), Cm(5.5))

It has been working perfectly fine, yet all of sudden starts returning an error:

textbox = pres.slides[0].shapes.add_textbox(Cm(0), Cm(0), Cm(19.25), Cm(5.5)) AttributeError: 'Slides' object has no attribute 'slides'

The presentation is instantiated with multiple slides as this point and has been working well in the past, the error just randomly arose. Thanks a lot!

razhakin avatar Jul 08 '22 06:07 razhakin

I suspect pres is not your Presentation object but a Slides object.

MartinPacker avatar Dec 27 '23 17:12 MartinPacker