I hope my problem hasn't already been solved. I'm having a problem compiling my python program into an executable. The program I want to compile is with tkinter and I use py2exe to compile. Here is my code for compiling:
from py2exe import freeze
freeze(
windows=[{'script': 'fichier.py'}],
options={
'bundle_files': 1,
'compressed': 1,
'dll_excludes': ['tcl85.dll', 'tk85.dll'],
'includes': ['os', 'ctypes', 'tkinter', 'PIL', 'tkinter.font']
},
zipfile='test.zip'
)
This returns the error to me:
Traceback (most recent call last):
File "C:\Users\henzo\OneDrive\Documents\python\auto_fond\setup.py", line 27, in <module>
zipfile='test.zip'
File "C:\EduPython\App\lib\site-packages\py2exe\__init__.py", line 176, in freeze
builder.build()
File "C:\EduPython\App\lib\site-packages\py2exe\runtime.py", line 273, in build
self.build_archive(libpath, delete_existing_resources=True)
File "C:\EduPython\App\lib\site-packages\py2exe\runtime.py", line 479, in build_archive
base = dist_path.rsplit('\\', 1)[0]
AttributeError: 'NoneType' object has no attribute 'rsplit'
In addition, I can't run my .exe after executing the program (I don't know if this is linked to the error). I would like to use the py2exe module because the other modules such as pyinstaller or cx_freezer do not work or tell me that there is a virus.
Thanks in advance.
Programmeurdu33
I'm looking for a solution to my problem. I've already looked everywhere but can't find anything.