pptx2md icon indicating copy to clipboard operation
pptx2md copied to clipboard

giving error on python 3.10.1

Open muralikodali opened this issue 3 years ago • 4 comments
trafficstars

pptx2md giving following error :

Traceback (most recent call last):
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/compat/__init__.py", line 10, in <module>
    Container = collections.abc.Container
AttributeError: module 'collections' has no attribute 'abc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/murali/.local/bin/pptx2md", line 5, in <module>
    from pptx2md.__main__ import main
  File "/home/murali/.local/lib/python3.10/site-packages/pptx2md/__main__.py", line 1, in <module>
    from pptx import Presentation
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/__init__.py", line 14, in <module>
    from pptx.api import Presentation  # noqa
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/api.py", line 15, in <module>
    from .package import Package
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/package.py", line 6, in <module>
    from pptx.opc.package import OpcPackage
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/opc/package.py", line 11, in <module>
    from pptx.compat import is_string, Mapping
  File "/home/murali/.local/lib/python3.10/site-packages/pptx/compat/__init__.py", line 14, in <module>
    Container = collections.Container
AttributeError: module 'collections' has no attribute 'Container'

muralikodali avatar Dec 19 '21 09:12 muralikodali

Hi, this error is from dependent package python-pptx and there is a similar issue: https://github.com/scanny/python-pptx/issues/750, which turns out to be a folder called "collections" in the same place where the command is called. Seems not a compatibility issue about python 3.10.

ssine avatar Dec 20 '21 03:12 ssine

Hi, applying the "monkey patch" from scanny did the job. In /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pptx/compat/init.py add import collections.abc after the line import collections

trothen avatar Dec 23 '21 15:12 trothen

My fault. This is indeed a compatibility issue of python-pptx with python 3.10. I'll update the package when this was fixed in python-pptx, at this time you should downgrade to python3.9 or patch it like above.

ssine avatar Dec 23 '21 15:12 ssine

I do not suppose there is an update on this issue. 😅 Getting the same error as muralikodali.

ahandsel avatar Oct 20 '22 12:10 ahandsel

Thanks to @MaxAFriedrich this issue was solved. see https://github.com/ssine/pptx2md/pull/36 .

try install the new version 1.3.0

ssine avatar Mar 16 '23 15:03 ssine