15

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).

Please, help me.

Dean Taler
  • 737
  • 1
  • 10
  • 25
Vladzrabbit
  • 167
  • 1
  • 1
  • 3

2 Answers2

29

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

Jossef Harush Kadouri
  • 32,361
  • 10
  • 130
  • 129
Paraclete
  • 291
  • 3
  • 4
0

Problem solved, i chanched python 3.10 to python 3.9.

Vladzrabbit
  • 167
  • 1
  • 1
  • 3