ImportError: cannot import name COMError in python

后端 未结 1 427
陌清茗
陌清茗 2021-01-18 06:42

I am trying to convert docx file to pdf with following code

import sys
import os
import comtypes.client


wdFormatPDF = 17

in_file = os.path.abspath(sys.arg         


        
相关标签:
1条回答
  • 2021-01-18 07:27

    Unfortunately COMTypes is designed for Windows, not Linux.

    comtypes allows to define, call, and implement custom and dispatch-based COM interfaces in pure Python. It works on Windows, 64-bit Windows, and Windows CE.

    Source

    You'll need to find another way to do your conversion, likely through another library.

    0 讨论(0)
提交回复
热议问题