Jones1220
Jones1220

Reputation: 786

AttributeError when loading pptx module in Python

I get the reoccuring AttributeError when trying to import the python-pptx module:

import pptx

AttributeError                            Traceback (most recent call last)
...
----> 8 import pptx.exc as exceptions
...
AttributeError: module 'pptx' has no attribute 'exc'

I am using the JupyterNotebook and have already reinstalled python-pptx using pip uninstall python-pptx pip install python-pptx. On stackoverflow, I found a related post here.

Even as I understand that it might not be loading the right module, I do not know how to proceed further in order to resolve the issue. Help is very much appreciated.

Upvotes: 0

Views: 709

Answers (1)

scanny
scanny

Reputation: 29021

Did you name your program pptx.py by any chance? Python would preferentially load that module instead of the library version.

You can find out what module was loaded with this at the Python prompt:

>>> import pptx
>>> pptx.__file__
'/somedir/.../python-pptx/pptx/__init__.pyc'

That may help narrow things down.

Upvotes: 1

Related Questions