Standalone Python EXE Executable - Python Kivy GUI Tutorial #20

preview_player
Показать описание
In this video we'll create a standalone executable .exe file for our Calculator app with Kivy and Python that you can share with your friends, or sell on your website, or whatever! We'll be using the free pyinstaller to do all of this work.

Step One: pip install pyinstaller

Step Five: Zip up all the files into one .zip file that you can share!
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Kivy Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

Me also gets this failed to execute script error. I tried ALL of the things already mentioned but it did NOT
work. Do you think I must try the GitBash terminal?

jannesbecker
Автор

Thank you. I repeated tutorial actions and got in in folder: C:\kivygui\calc\dist\calc only one exe file 'calc.exe' and a subfolder named ''_internal". Trying to run calc.exe I got error of lacking calc.kv.
I copied calc.kv next to calc.exe and app runs as it should be.

zbyszeks
Автор

I have seen that you can't multiply two numbers like 3.5×4.4 or something like that can you please fix it or have I done a mistake in my code I don't know. The same by division two numbers like 8.1/5.3 doesn't work.

starbassthema
Автор

Cool. 'Course it does nothing for me since I'm on Linux. But very interesting regardless.

boblittle
Автор

Hi,

I tried to create exe from my python kivy code and i can able to create exe with console(means console also opening parallely). So what i need is without console the exe should work. But when i try the command --noconsole or --w or --windowed these commands i am facing error. Please help me here.

The below commands i tried,
> pyinstaller --onefile --noconsole --add-data=SystemsEOL_.kv;. --add-data=EmersonAPI.py;. --add-data=hpxlogo.jpg;. --add-data=i_o.png;. --add-data=PV.jpg;. --add-data=run_test.jpg;. --add-data=units.csv;. Main.py

then in Main.spec file added below things,

from kivy_deps import sdl2, glew



exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
[],



>pyinstaller --clean "Main.spec"

But still facing the issue. I was trying this for long time unable to resolve till now please help.

shobinb
Автор

Though that you over explained the simple stuff and missed out to explain the complicated ones, like the doble \\, what were those files you imported.... But it was ok nonetheless

andres
Автор

Hi! How can we manage to have a single executable file with all the dependencies in it instead of a directory ?(equivalent to the --onefile command)

huguesrubin
Автор

not sure if he made another video on this but an easier way is using "auto-py-to-exe". You could select the py file and then add any additional files with it. No need to code anything.

Albrazi
Автор

ModuleNotFoundError: No module named 'kivy_deps'

yea so that error happened

aking
Автор

The title says "standalone" but this video shows

abdulbasitb
Автор

I have found you need to have kivy installed properly, if you just imported it from python without doing anything in the command prompt it will not work (at least not for me, follow the first tutorial in the kivy series here), also, the python used in your command prompt can be different then the one in the python file itself, make sure its 3.9 or less, 3.10 currently doesn't work

after 2 hours of fixing all the stuff and reinstalling python so i only have 3.9 on my computer since i cant find how to switch between versions on the internet it worked

jaffedenaegel
Автор

Hey John,
your videos are really amazing. You are a great teacher. I've been following your playlist on python gui tutorial and really understanding how things work. I use linux operating system (ubuntu) and im not able to create a standalone python executable file for linux. Can you please help me with it?

NishanthAmbati
Автор

Good video this calculator works perfectly in my laptop and I want to take advantage of the oportunity to tell you that I tried to send the calculator.exe to some guys but the app just work with people who have python in their computers, otherwise the SO sent a fatal Error. In this case if I want to create a desktop apps with kivy, should I add the interpreter of python inside the calc directories in order people install python before executing the calc.exe, or What should I do instead ?

erickedgardolandaverdealas
Автор

I used auto-py-to-exe for creating a simple exe file. At first I had to paste the .kv file content as a string right into the .py file. Then I didn't have to write any additional things into the specs etc. Actually, I created it as an One File, Window Based file so no additional folders or files were created anyway. It worked fine right at the first attempt. Then I made a few more attempts with having the separate .kv file and I tried to add it to the rest during the auto-py-to-exe process, similarly like I used to do when I was creating exe files from my customtkinter files. It didn't work. No problem though. The first method is easy and I think it's better. You have just one exe file and nothing else to mess with.

elevendarter
Автор

hey I have a {module has no attribute 'selectImports'} error. I can't solved it. someone know how can I fix it?

idodahari
Автор

What if I am uaing sqlite database, how can I include that in?

SanjayKumar_optimist
Автор

Is there any way to create an executable file for raspbian OS using Windows?

hamzahassan
Автор

Sir I am getting
Failed to execute script error
?

cwtiwari
Автор

I got this weird error, I followed this video step by step but still came out bad. Any Ideas?

Unhandled exception in script
Failed to execute script 'main' due to unhandled exception:
'NoneType' object has no attribute 'size'
Failed to obtain/convert traceback!

maksimkobylyuk