title: Why is the docx2pdf module not converting docx to pdf in my Python script Mac OS?
body: <p>I'm using Python 3.8 and docx2pdf 0.1.7. I've been trying for ages to get something something in my script which will convert a docx to a pdf. I've tried all sorts of stuff but nothing has worked for me thus far.</p>
  <p>There's a module called docx2pdf which should convert the file I just created but it doesn't seem to work and I can't figure out why that's the case. I tried running it in my script but I also tried running it as a subprocess but neither worked. Documentation of the module is <a href="https://pypi.org/project/docx2pdf/" rel="nofollow noreferrer">here</a>.</p>
  <p>I think this is a pretty unknown module as I couldn't find any answers on the internet so I'm hoping there is someone who knows how to tackle this problem.</p>
  <p>This is the code I'm working with:</p>
  <pre><code>from docx import Document
  from docx.shared import Pt
  from tkinter import *
  from docx2pdf import convert
  
  root = Tk()
  
  # Then some irrelevant code for this question
  
  def updater()
      doc = Document('./Contract.docx')
      # Then some code which updates the doc according to the tkinter Entry input
  
      # Save it according to some of the input from the GUI
      doc.save('/Users/Jem/Documents/Huurovereenkomsten/Specifiek/{}/contract{}.docx'.format(nospaceadres,
                                                                                                         naamhuurder.get()))
  
      # It all works fine until here
      convert('/Users/Jem/Documents/Huurovereenkomsten/Specifiek/{}/contract{}.docx'.format(nospaceadres,
                                                                                                         naamhuurder.get())) # This should convert it to a pdf with the same name in the same folder
  
  # Some Tkinter GUI code which is also irrelevant for this question
  
  root.mainloop()
  </code></pre>
  <p>But first, it gives me this:</p>
  <pre><code>0%|          | 0/1 [00:02&lt;?, ?it/s]
  </code></pre>
  <p>Then it opens MS Word on my macbook and tells me it needs a permit / rights to open the docx. I then have to select the document, which gives it the permit to open it. After that, it opens the docx but nothing happens.</p>
  <p>After that, it gives me this:</p>
  <pre><code>{'input': '/Users/Jem/Documents/Huurovereenkomsten/Specifiek/slotlaan73/contractabc.docx', 'output': '/Users/Jem/Documents/Huurovereenkomsten/Specifiek/slotlaan73/contractabc.pdf', 'result': 'error', 'error': 'Error: Er heeft zich een fout voorgedaan.'}
  </code></pre>
  <p>'Er heeft zich een fout voorgedaan.' is Dutch for: an error has occurred.</p>
  <p>Does anyone know why this is happening or what I could do to make it work so that it converts the docx to a pdf?</p>