def _handle_broken_tcl_tk():
 if (is_win and is_venv):
  basedir = os.path.join(base_prefix, 'tcl')
  files = os.listdir(basedir)
  for f in files:
   abs_path = os.path.join(basedir, f)
   if (f.startswith('tcl') and os.path.isdir(abs_path)):
    os.environ['TCL_LIBRARY'] = abs_path
   elif (f.startswith('tk') and os.path.isdir(abs_path)):
    os.environ['TK_LIBRARY'] = abs_path
   elif (f.startswith('tix') and os.path.isdir(abs_path)):
    os.environ['TIX_LIBRARY'] = abs_path

def _handle_broken_tcl_tk ( ) : if ( is_win and is_venv ) : basedir = os . path . join ( base_prefix , 'tcl' ) files = os . listdir ( basedir ) for f in files : abs_path = os . path . join ( basedir , f ) if ( f . startswith ( 'tcl' ) and os . path . isdir ( abs_path ) ) : os . environ [ 'TCL_LIBRARY' ] = abs_path elif ( f . startswith ( 'tk' ) and os . path . isdir ( abs_path ) ) : os . environ [ 'TK_LIBRARY' ] = abs_path elif ( f . startswith ( 'tix' ) and os . path . isdir ( abs_path ) ) : os . environ [ 'TIX_LIBRARY' ] = abs_path
when freezing from a windows venv .