0

I couldnt found a solution "ansewered" here, so I'll post what I found of bug and the solution that I made here and the links that helped me.

The problem was: When I was importing the docx

import docx 

I got the bug:

import docx
Traceback (most recent call last):

  File "<ipython-input-3-326e089686b3>", line 1, in <module>
    import docx

  File "C:\Users\T722696\AppData\Roaming\Python\Python37\site-packages\docx.py", line 30, in <module>
    from exceptions import PendingDeprecationWarning

ModuleNotFoundError: No module named 'exceptions'
Felipe Ribeiro
  • 84
  • 1
  • 10
  • Tks @Deep, the idea here is to make the step by step and also to mark this as answer, since this other one above is not marked as solved. – Felipe Ribeiro Oct 01 '19 at 14:30

1 Answers1

-2

I found this solution here, but it was not marked as solution. So I'm marking this as solution and giving the right credit to @Dmtry and do @dsh Since docx is not "yet" compatible with Python 3.7, the solution is to change docx itself when using Python 3.7:

Step by step:

1) Open the docx.py

2) You'll find this:

row | code

25  | try:
26  | from PIL.ExifTags import TAGS
27  | except ImportError:
28  |    TAGS = {}
29  |
30  | from exceptions import PendingDeprecationWarning

3) you must remove the line 30 and insert what is below:

try:
    from exceptions import PendingDeprecationWarning
except ImportError:
    pass

4) This should solve your problem.

Felipe Ribeiro
  • 84
  • 1
  • 10
  • 3
    I think the better solution is actually [the one of @Arun](https://stackoverflow.com/a/44233838/3864300), which is to use the Python 3 version of the package. We should never tinker external dependencies. – frankie567 Oct 01 '19 at 14:38