Reputation: 94
This is setup file which I am using
import cx_Freeze
import sys
import os
base = None
if sys.platform == 'win32':
base = "Win32GUI"
os.environ['TCL_LIBRARY'] = r"C:\Users\osama shakeel\AppData\Local\Programs\Python\Python37-32\tcl\tcl8.6"
os.environ['TK_LIBRARY'] = r"C:\Users\osama shakeel\AppData\Local\Programs\Python\Python37-32\tcl\tk8.6"
os.environ['TK_LIBRARY'] = r"C:\Users\osama shakeel\AppData\Local\Programs\Python\Python37-32\tcl\treectrl2.4.1"
executables = [cx_Freeze.Executable("alkhidmat.py", base=base, icon=r"C:\Users\osama shakeel\PycharmProjects\alkhidmat-project\icon.ico")]
cx_Freeze.setup(
name = "Alkhidmat Management System",
options = {"build_exe": {"packages":["tkinter"], "include_files":[r"C:\Users\osama shakeel\PycharmProjects\alkhidmat-project\icon.ico",'tcl86t.dll','tk86t.dll', 'icons2']}},
version = "0.01",
description = "Tkinter Application",
executables = executables
)
And these are the libraries which I am using.
import tkinter as tk
from tkinter import ttk
from tkcalendar import Calendar, DateEntry
from csv import DictWriter, DictReader
import os
import tkinter
from TkTreectrl import *
import pandas as pd
And this is error which I am getting after my installation of app External package which I downloaded is TkTreectrl, and another function of program is automatically creates csv file in the current directory where my(alkhidmat.py) file is present
cx_Freeze: Python error in main script
Traceback (most recent call last):
File "C:\Users\osama
shakeel AppData\Local\Programs\Python Python37-32\lib \site
-packages\cx_Freeze\initscripts _startup_.py", line 40, in run
module.runo
File "C:\Users\osama
shakeel AppData\Local\Programs\Python Python37-32\lib\site
-packages\cx_Freeze\initscripts\Console.py", line 37, in run
exec(code, [name__ main__'})
File "alkhidmat.py", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter
ок
1
Upvotes: 0
Views: 516
Reputation: 47
I can give you a great advice,D'ONT USE CX-FREEZE, use auto-py-to-exe. using this module, you will be ableto add an personal icon to your app, also add additional files in a very easy way.And here is the link to install it from you cmd here
Upvotes: 0
Reputation: 1
try to look in your ./lib folder (in your bulid folder) and rename "Tkinter" folder to "tkinter"
Upvotes: -1