0

I have a calendar build with tkcalendar and i want to make it an executable file that i can send for people to test out and give me feedback. However i cant seem to run it unless i am using python.

I tried py2exe and pyinstaller

from tkcalendar import Calendar, DateEntry from inputs import * from quickstart import * from Customization import * from importlib import reload try: import tkinter as tk from tkinter import ttk import datetime except ImportError: import Tkinter as tk import ttk Button_Light = ttk.Button(root,text='Light Style', command=Main_Body_white) Button_Dark = ttk.Button(root,text='Dark Style', command=Main_Body_Black) enter_button2 = Button(root, text="Make-Event", command=Create) Button_Dark.pack() Button_Light.pack() enter_button2.pack() 

So this code works 100% but it wont open unless in python. This code grabs many different modules and combines them to create the final result

File that contains all the code for the program

I think because This code relies heavily on GUI and thats where the issue is happening.

The Gif show the problem i am having

[![enter image description here][3]][3]


enter image description here

Still no luck But this might explain better. As you can see the code does run in cmd. But it dosent RUN the GUI part

4

2 Answers 2

2

Install the module pip install auto-py-to-exe, it is working for me, after installing type auto-py-to-exe in python prompt command line auto-py-to-exe window will appear. Put input() at the end of your python script and then select your script location, do not change output folder destination, after making executable open output folder, copy or cut the .exe application and paste it anywhere outside C drive. It'll work without using python. auto-py-to-exe window image attached for your reference. enter image description here

Sign up to request clarification or add additional context in comments.

5 Comments

This was the closest, It worked for most part but i got a module babel.numbers not found. will look into that now
Use pip install Babel and restart your terminal & auto-py-to-exe window and then try
ModuleNotFoundError: No module named 'babel.numbers'
Go to this link github.com/python-babel/babel/blob/master/babel/numbers.py and copy the script in Babel folder and then try
still the same :(
0

First you need to make 1 folder and paste all files there:

Then you need to paste your folder to python directory where python install to make sure to paste in the script folder

In My case python is install on this directory:

C:\Users\Hamza Lachi\AppData\Local\Programs\Python\Python37-32\Scripts 

and then type this command:

pyinstaller -w -F '.\file_name.py' 

It Will Converts python file into exe file

Why Exe Can't Run:

if you link files to python file that's why your python script is not working so you need to paste that files! in exe directory

For Example:

If You Link images so if script not working so you need to copy images in exe directory

SOLUTION

Copy all files in exe directory

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.