I have written a code that takes several pictures from a folder and collates them into a company-specific PowerPoint template. Within the code, I am indicating the location of the template, which is in the same directory as the .py file. However, upon creating a .exe file it results in an error in the line that specifies the template of the presentation:
template = os.getcwd() + '\\template.pptx'
prs = Presentation(template) ### ERROR OCCURS HERE
Is there a way to embed my own power point template while building .exe file. I have tried putting it into .spec file, by indicating the location of the custom pptx template in datas, which I put into the site-packages as follows:

p = "C:\\Users\\<username>\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\site-packages\\pptx\\templates\\my_template.pptx"
block_cipher = None
a = Analysis(['Pictures_to_Slides.py'],
pathex=[],
binaries=[],
datas=[ (p, '.\\pptx\\templates\\') ],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
After doing this the .exe file was created successfully but again resulted in error at the stage of declaring Presentation("my_template.pptx)
Does anybody have an experience with building custom pptx templates within .exe files?
I have written a code that takes several pictures from a folder and collates them into a company-specific PowerPoint template. Within the code, I am indicating the location of the template, which is in the same directory as the .py file. However, upon creating a .exe file it results in an error in the line that specifies the template of the presentation:
Is there a way to embed my own power point template while building .exe file. I have tried putting it into .spec file, by indicating the location of the custom pptx template in
datas, which I put into thesite-packagesas follows:After doing this the .exe file was created successfully but again resulted in error at the stage of declaring
Presentation("my_template.pptx)Does anybody have an experience with building custom pptx templates within .exe files?