Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fail: AttributeError: module 'collections' has no attribute 'Container'

I try to start python-pptx, but I have Error:

AttributeError: module 'collections' has no attribute 'Container'
in File "...\lib\site-packages\pptx_init_.py", line 14 

Use Python 3.10, python-pptx (0.6.21), lxmx (4.6.3).

like image 765
Vladzrabbit Avatar asked Dec 28 '25 12:12

Vladzrabbit


1 Answers

It's a known issue for Python 3.10 as discussed in this issue. The workaround is to import both modules collections and collections.abc before importing pptx. For example:

import collections 
import collections.abc
from pptx import Presentation

This should resolve this error

like image 153
Paraclete Avatar answered Dec 31 '25 00:12

Paraclete



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!