0

I am trying to create an executable file which is using module python-docx.

The executable files is created but this error occurs when I run the executable file.

[Errno 2] No such file or directory: 'D:\Pycharm Projects\pydocx\dist\library.zip\docx\parts\..\templates\default-footer.xml'

The normal .py file which I am trying to convert into a .exe works perfectly fine.

Can anyone suggest how should I resolve this

  • 1
    I think you'll find this has to do with the `data_files` setting in the `py2exe` configuration, something like what is mentioned here: https://stackoverflow.com/a/2748026/1902513. They are not included by default perhaps. You'll need everything in that `templates/` directory to be included (so you shouldn't need to call them out one-by-one). – scanny Jul 09 '21 at 19:15

1 Answers1

0

Switched to pyinstaller and everything worked flawlessly.