title: ImportError: cannot import name COMError in python
body: <p>I am trying to convert docx file to pdf with following code</p>
  
  <pre><code>import sys
  import os
  import comtypes.client
  
  
  wdFormatPDF = 17
  
  in_file = os.path.abspath(sys.argv[1])
  out_file = os.path.abspath(sys.argv[2])
  
  word = comtypes.client.CreateObject('Word.Application')
  doc = word.Documents.Open(in_file)
  doc.SaveAs(out_file, FileFormat=wdFormatPDF)
  doc.Close()
  word.Quit()
  </code></pre>
  
  <p>It is throwing an error </p>
  
  <pre><code>ImportError: cannot import name COMError
  </code></pre>
  
  <p>I have installed comtypes package.</p>
  
  <p>I am very new to python, I can not figure out how to resolve this problem.</p>
  
  <p>[Edit]</p>
  
  <p>Stacktrace</p>
  
  <pre><code>Traceback (most recent call last):
    File "converttopdf.py", line 3, in &lt;module&gt;
      import comtypes.client
    File "/usr/local/lib/python2.7/dist-packages/comtypes-1.1.2-py2.7.egg/comtypes/__init__.py", line 23, in &lt;module&gt;
      from _ctypes import COMError
  ImportError: cannot import name COMError
  </code></pre>