Having problems with cx_Freeze and making an executable

18 Views Asked by At

I've written a Python script that I need to make into a stand alone executable. I'm trying to use cx_Freeze, but I keep getting recursion errors. I've seen that this question has been asked before, but none of the solutions I could find seem to work for my situation. My script is importing the following libraries:

import tkinter as tk
from tkinter import ttk
import itertools
from datetime import datetime
from PIL import Image, ImageTk

I've tried making the executable with two different setup scripts. Here they are:

import sys
from cx_Freeze import setup, Executable
build_exe_options={
    'excludes':[],
'zip_includes_packages':['tkinter', 'itertools', 'datetime', 'PIL'],}
setup(name='script', version='1.0', description='', executables=[Executable('C:/Temp/Name/.spyder-py3/file.py')])

This is the other setup I have tried:

import cx_Freeze, sys
base=None
if sys.platform == 'win32':
   base='Win32GUI'
executables = [cx_Freeze.Execuatble('C:/Temp/Name/.spyder-py3/file.py', base=base)]
cx_Freeze.setup(name='script', options={'build_exe':{'packages':['tkinter', 'itertools', 'datetime', 'PIL'],'includ_files':['C:/Temp/Name/.spyder-py3/image.png']}},
version='1.0',
description='',
execuatables=executables)

For both setups, when I run the following command in the Anaconda prompt

python c:/Temp/Name/.spyder-py3/file.py build

I get this error:

RecursionError: maximum recursion depth exceeded in __instancecheck__

I've looked for solutions on this site and many others, but I can't find any reference to __instancecheck__. Does anyone know what that is? And is there something wrong in my setup scripts?

0

There are 0 best solutions below