Use the flag --windowed, so that black console window won't show up.
@Codemycom4 жыл бұрын
perfect! thanks!
@Kroenenprime4 жыл бұрын
You can also just save your file as .pyw it does the same
@Codemycom4 жыл бұрын
@@Kroenenprime That only works if you already have python installed on your computer...most people don't.
@davitvekua68784 жыл бұрын
oohh man thank u so much!
@vishvanthsaravanakumar30784 жыл бұрын
--onefile -w (for one file without triggering console)
@MadhuKraft4 жыл бұрын
Before you turn it into a exe, rename the file to .pyw instead of .py That will get rid of the command prompt that always shows up
@Codemycom4 жыл бұрын
or just use the -w flag when building the exe
@mohammadrezasharif8432 жыл бұрын
I tried this but "Ordinal Not Found" error shows up when I run the exe.
@unknowngalaxy78502 жыл бұрын
Thank you very much
@Brimstoned_11 ай бұрын
NO in the pyinstaller just use --noconsole and no console will apear
@youzuko11 ай бұрын
@@Brimstoned_ i tried to use the --noconsole but windows flagged it as virus. same with -w. no idea why, it works just fine without getting rid of the console.
@popotoITA2 жыл бұрын
in order to avoid the "command window" to pop up when you run the executable, you just have to write "-- noconsole" along with the pyinstaller call
-w (or --windowed, or --noconsole) This will get rid of the blank CMD from popping up during launch --name="" This will name the app differently from your . py file --icon= (note, if you have your images in sub folders you need to use the path to that folder. Example: images/lock.ico --onefile (this one is hit and miss. Sometimes I do without this one to get app running right)
@jacinthompeteye30373 жыл бұрын
Great tutorial, we can also add '--noconsole' in the command prompt to hide the black window
@aszaw5342 Жыл бұрын
or simply -w
@arturdashev53532 жыл бұрын
IT'S ALWAYS THE UNDERRATED VID THAT'S LEGIT! THANK YOU!
@Codemycom2 жыл бұрын
Thanks...but I wouldn't call a video with 200,000+ views underrated ;-)
@raghvendra874 жыл бұрын
Thank you Mr. White!
@Codemycom4 жыл бұрын
You bet
@subtemprodrigoes81643 жыл бұрын
It's Mr. Elder, what the hell?
@scoliidaeai4933 жыл бұрын
save the .py file as a .pyw , it runs the exact same as a regular python file but runs without the shell window
@SanyogLamsal3 жыл бұрын
Underrated Comment
@DanielMemeSmith3 жыл бұрын
@@SanyogLamsal not underrated. see other comments
@SanyogLamsal3 жыл бұрын
@@DanielMemeSmith This one worked for me.
@Iamzaidmnr4 жыл бұрын
wowwww! i just made my first executable file! Thanks.
@Codemycom4 жыл бұрын
Awesome!
@Codemycom3 жыл бұрын
@زاكي Zaky did you pip install it?
@Matt-ke7mc4 жыл бұрын
This was great!! So straightforward and useful. I was able to build a front end GUI app for my python script at work because of this video. Awesome job man.
@Codemycom4 жыл бұрын
Glad it helped!
@funshorts12484 жыл бұрын
What if our program uses some images ? can we still run the exe file isolated without those ..? since i got an error
@akshitmiglani54194 жыл бұрын
You'll have to put that image into the temp directory where the back-end files of stand-alone app are created.
@holycow48893 жыл бұрын
I had several issues when i was triying to turn my TK application into an .exe file. In case you have some issues as well(not opening etc) use auto-py-to-exe. >>pip install auto-py-to-exe < to install it >>auto-py-to-exe < to open it -I hope i could help for those people that are having problems :)
@nashonmumo56794 ай бұрын
This is awesome. Like and subscribed to my best presentation ever!
@Codemycom4 ай бұрын
Welcome aboard!
@unknowngalaxy78502 жыл бұрын
Thanks for this tutorial! Finally my school project has been completed. 🙂
@code62593 жыл бұрын
your a boss sir i watched all your videos there amasing sirtenly with your dog
@AdAstraCan3 жыл бұрын
I just signed up for the full membership. Thanks for making useful videos.
@Sergio-td7mn4 жыл бұрын
I watched many parts of the series and its awesome, thank you John!
@Codemycom4 жыл бұрын
Glad you're enjoying it!
@kingsleyemeka21364 жыл бұрын
Yeah, me too You're a great teacher
@vicesodan2 жыл бұрын
Tip: Application won't start without icon next to it on another pc if you use an icon instead of tkinter default icon on its windows, check the path of the icon in python code also
@RyanDanielG3 жыл бұрын
wow cant believe I hadn't run across this before. thanks, mate!
@Codemycom3 жыл бұрын
Sure thing
@rajatpatel18174 жыл бұрын
For people who have used images and icons in their code, you need to have those images and icons in the same folder as in code for it to work. a little tip here: keep all your images and icons in a single folder such as 'resources' and change your code so that those images can be read from resources directory. this way, you will only have one exe file and the rest in the resouces folder. clean and efficient.
@Codemycom4 жыл бұрын
Good tip
@mukulM20104 жыл бұрын
Hey I'm getting the "File not found" or "File not defined" error as I have images and sounds in my python code. How do I set the file path of these images in my python code so that the executable works on any other computer? Like even if I copy them in a single folder... the .filepaths need to be updated in the .py file
@thedude62132 жыл бұрын
@@mukulM2010 Hey, so i can see you commented this a year ago but I'm trynna figure this out myself. Did you find a solution?
@djbroake98102 жыл бұрын
@@thedude6213 'folder/file.x' should work in the scrip, then keep x files in x folder next to the exe.
@allenhirahara22424 жыл бұрын
THANK YOU. I was trying to look up how to make an executable .exe, but the program that you used to make the .exe actually helped me with my program. I had a problem with inputting the text into the same window and the "myLabel = tkinter.Label(root, text) " helped. Thank you!
@Codemycom4 жыл бұрын
Glad I could help!
@neoZodiacEth2 жыл бұрын
you can install auto-py-to-exe and run this int he terminal in order to convert your .py to a .exe! Also there is a setting to remove the black console window!
@vishalsalvankar93734 жыл бұрын
Hey John, I was successful in creating python exe file, but while using tjr same file on another computer, it got detected as a virus. Basically any exe file which i create is shown as a virus. How can i solve this problem other than adding the file as exception in any antivirus software?
@emperorj47833 жыл бұрын
The guys who disliked are ppl who hate Python Python is a legend and so is Codemy.com
@Codemycom3 жыл бұрын
Thanks!
@manigandandmx3 жыл бұрын
Bitdefender antivirus is detecting the stand alone EXE file as virus and keeps on removing it as soon I create it. Please advise.
@omarabdelfattah98363 жыл бұрын
very good video and very easy method thanks a lot
@Codemycom3 жыл бұрын
Glad you liked it
@benjaminodriscoll66054 жыл бұрын
Thanks for the video and the entire playlist, it has been so helpful! Subscribed and liked!
@Codemycom4 жыл бұрын
Glad you're enjoying them!
@fcmorena2464 жыл бұрын
Thanks for the course, i really appreciate it, i kind of have a little problem.
@Codemycom4 жыл бұрын
ok?
@fcmorena2464 жыл бұрын
@@Codemycom I lack self-confidence when coding.
@Codemycom4 жыл бұрын
@@fcmorena246 it comes with practice
@fcmorena2464 жыл бұрын
@@Codemycom okay thanks Sir i have another problem Yesterday I created a text editing software with pyinstaller, when I run the program it pops up an error. (Fatal Error Detected Failed to execute script ...
@stephenwilson03862 жыл бұрын
I'm having issues with Windows Defender flagging my exe file as a Trojan. It only seems to happen when I use the --onefile flag, but it defeats some of the purpose of packaging my script if my coworkers have to keep the two directories as they are in order to use the program. Sending one executable file would be much cleaner. Does anyone have any suggestions?
@MitraElectronics3 жыл бұрын
Thanks for this tutorial, I had been trying to do that since ages. Really appreciate your work.
@Codemycom3 жыл бұрын
Glad you liked it
@hareknowsnone4 жыл бұрын
Try to run this 'standalone program' in any other windows computer( if possible except windows10 ) . It does not work for me at least. Also will it work on other os?
@slasaru3 жыл бұрын
Thank you so much for the info that I can clean up everything besides the main file!
@dsgarden4 жыл бұрын
You teach better than EPFL
@Codemycom4 жыл бұрын
I don't know who that is...but thanks!
@novashi59964 жыл бұрын
@@Codemycom EPFL = Easy Pee F**k Love by the way you teach better than MCDS
@mahanaatma9103 жыл бұрын
i learned how to put icon in exe file so thankyou
@Codemycom3 жыл бұрын
welcome
@giuseppecipolletta14434 жыл бұрын
Hi John! Thanks for this! What if I have a picture in my code? Is there a way to specify it as we do with the icon?
@giuseppecipolletta14434 жыл бұрын
Ive tried with --add-data but it doesn't seem to work: pyinstaller.exe --onefile --icon=Icon3.ico --add-data="Image.png;img" PySprings.py
@adotac2 жыл бұрын
how will this work if my program needs to have atleast multiple scripts? do I just build from my main script?
@sammiyin35164 жыл бұрын
Suuuuuuuuuuuuper helpful tutorial. Thank you John!
@Codemycom4 жыл бұрын
Happy to help!
@isurangacooray92384 жыл бұрын
You're the best sir ❤️ thanks a lot for this whole playlist
@Codemycom4 жыл бұрын
You're very welcome!
@Elijah3_863 жыл бұрын
Did you make a later videos for better ways to do this? Pyinstaller makes the program run really slowly on another computer
@BrazybranButOutside3 жыл бұрын
The computer I coded the .py file on, once turned into an .exe file, still works perfectly, until I move it to another computer for download. When I do so its detected as a virus. I would like to sell software soon so this is an issue I'd love to eliminate. I'm still learning, but to test converting .py into .exe I made a simple calculator program. Not very modern visually and not too many lines of code. But it still is flagged on other computers. Help plz!
@kmcasi20374 жыл бұрын
I see comments whit "-w" so in fact for what is good that CMD/shell is for debuging. Not all side packages are easy packed with pyinstaller so for that reason I make EXE like in your video for debug some missing packaged fils and to reimport them. By default python IDLE run true terminal and -w is optional. P.S.: 1 - *.pyc files are your python files but encripted. (on big project fiorst time will take a while to package but after that edited .py files are encripted again... pyinstaller use encrypted files to protect your project information for that reason is take a while to make that .pyc) 2 - a second option if you want to not have opened that CMD/shell/terminal by python you can rename your file extension from PY to PYW (w will prevent opening terminal.) and with that pyw you do not need to insert that extra -w on pyinstaller lcommand
@Codemycom4 жыл бұрын
That only works if the people you share your program with have python on their computers too.. most people don't.
@abhirammelattur90374 жыл бұрын
Hey Wait!! You are Heisenberg from BreakingBad right?¿
@Codemycom4 жыл бұрын
:-p
@tomoyaokazaki99153 жыл бұрын
Sir I made the app with pyinstaller I opened it in my pc its working totally fine but when I shared only the .exe file of my app to my friend then in his pc that app is not opening [He goes in the location where my app is saved and clicks it and installs it and then when he opens only that black command line window appears then after 2-3seconds the command line box disappears and the application window doesn't appears.] Help me fix the problem sir
@jimbowhitt38162 жыл бұрын
hey, great video here helped me alot. However i have a image file in my code, which when i create a .exe it launches but flags a error saying the image can't be found. am i missing something here, in my code i have the 'my_img = ImageTk.PhotoImage (Image.open("image.png"))' which maps to the location of my image in my code and works when operating though python directly. when operate through .exe basiclly says "failed to execute due to unhandled exception: [Errno 2] no such file or directory: 'image.png'
@manojkumarleo4 жыл бұрын
Awesome Sir, This helps a lot.
@Codemycom4 жыл бұрын
Glad to hear that
@garyclayton6212 Жыл бұрын
Just seen your video #40 - I did look below but couldn't see a comment about this so sorry if already there. To stop the terminal window just add "--noconsole" to the command line. Regards.
@himanshubhatti47174 жыл бұрын
sir I did it..but problem is that when I double click on my final .exe file only black window opens not the GUI window
@Codemycom4 жыл бұрын
try the -w flag in the command
@Capsaicinophile2 жыл бұрын
Thanks for the valuable video. You can use --noconsole to get rid of the console.
@RDKCREATIONS3 жыл бұрын
i have a json file in my project how can i do it
@gbilo242 жыл бұрын
Use thanks for this amazing free content!
@codegeassprogramming3 жыл бұрын
If we import other libraries the converted exe file do not have that libraries
@varghapayandeh30244 жыл бұрын
Thank you for the video. Of couse why not using the "--noconsole" argument to the command so it wouldn't create that console?
@Codemycom4 жыл бұрын
yes
@benjamin79394 жыл бұрын
I never knew Walter White made Python tutorials
@Codemycom4 жыл бұрын
lol
@elchinefa95244 жыл бұрын
lol man exactly i thought i saw him before =D
@Codemycom4 жыл бұрын
@@elchinefa9524 lol
@ShashwataSaha3 жыл бұрын
What if my python project got multiple files linked with eachother?
@tobias26883 жыл бұрын
What can I do when my python file relies on some external libraries? Would I have to pack the whole library into the .exe file? Thanks!
@djremedy16943 жыл бұрын
Pyinstaller has the built in feature to sweep through your python script, find all the import statements, and then copy those libraries during the conversion process
@sailendrachettri85213 жыл бұрын
.exe is cool But how can I create for mac or Linux :)
@rayofvictory3 жыл бұрын
You have to use a Mac or a Linux box to target for those environments. You can’t use Windows PC to get Mac app.
@sailendrachettri85213 жыл бұрын
@@rayofvictory I am using Linux but can't able to create for Linex itself :(
@junmarcado445 Жыл бұрын
Thank you very much sir.
@Codemycom Жыл бұрын
Welcome
@ReneAshu-fb5fd Жыл бұрын
Thanks a lot for this valuable content. You are really changing lives one at a time. What is the advantage in not simply using it as a .pyw file and having the end user install python on their machine. I reasoned that since we all first install say Microsoft Office on our machines before opening say a word document? The same is true here. We can just create our python file as a .pyw files, and have the end user first install python on their machine, so that they can deploy our code by just double clicking on the file or its shortcut as we do with other programs. The extra thing that i may do is rather customize the icon on the file with my own personal logo. if we want to make it look like a commercial stand alone product, then we can include say a batch file in our package. In the batch file, we instruct the operating system to install python, and from there we work more magic.
@Codemycom Жыл бұрын
because no one will do that. Also your code will be exposed to people...which you rarely ever want.
@brucenik91684 жыл бұрын
Great job. Can you please tell me what you use for screen capture and video editing for that amazing clean green effect? Also, what microphone you use? :)
@Codemycom4 жыл бұрын
sorry, state secret :-p
@Codemycom4 жыл бұрын
@Aanshumaan Shrijai VII C no, I don't talk about that stuff
@sinuheso4 жыл бұрын
Hi there,thanks for your videos. I have a question, im working in a GUI using tkinter, the python file size is 257 KB. When i create executable using pyinstaller, the size of the GUI is 100 MB. What could be the reason?
@Codemycom4 жыл бұрын
exe files are bigger. that's common
@7s9n2 жыл бұрын
You must create a virtual environment for your project 🙂
@sinuheso2 жыл бұрын
@@7s9n Thank you
@7s9n2 жыл бұрын
@@sinuheso Your welcome 💛
@paulwatterson59922 жыл бұрын
Thank You great video
@Codemycom2 жыл бұрын
Thanks
@atom98853 жыл бұрын
thank you so much steve jobs
@Codemycom3 жыл бұрын
:-)
@dandisinfographicchannel13464 жыл бұрын
hello, i have a problem with this method when i try to run the program on my other pc
@saranshmogha41394 жыл бұрын
so Walter White moved from Chemisrty to python...anyways....great video as always.
@Codemycom4 жыл бұрын
Ha funny
@cheasteral76363 жыл бұрын
Sir can I convert py to exe including sqlite3 database imported in my python app?
@sirfaboyt33952 жыл бұрын
Do you have now a solution? I face the same problem right now... 11 Months later xD I hope you can help me now haha
@nihalthannegedarapremaratn23523 жыл бұрын
if it is a big program (with dashboard and other..mysql), can we run like this..?
@mustafamontaser49553 жыл бұрын
thanks sir it really works!
@Codemycom3 жыл бұрын
Welcome 👍
@nemithafernando57563 жыл бұрын
I made a text editor and when I was convert it to an exe file Windows defender is blocking it Please I want your help
@Codemycom3 жыл бұрын
Windows defender blocks any apps it doesn't recognize, not just tkinter.
@sumanabhattacharyya70333 жыл бұрын
When ever i see him in the thumbnail i instantly clicks the video
@Codemycom3 жыл бұрын
ha thanks!
@raviarumugam56724 жыл бұрын
this don't works for me. after I converting my .py files to exe I'm unable to open the exe files.
@nicholas_eras3 жыл бұрын
same here
@nicholas_eras3 жыл бұрын
Nvm got it working. Just placed the .ico in dist folder
@otisbeaumont67974 жыл бұрын
Hey John, Thanks for your videos. I am on vacation leave and started learning Python and Tkinter on my own with the help of some Google searches and KZbin videos such as yours. Your Videos are super great! In a way, 'thanks for the pandemic lock down'. Well understand me. If you type a single - and a w (-w) after you typed the icon+"name".ico that command prompt will not show up. again, thanks for your videos.
@Codemycom4 жыл бұрын
Glad you're enjoying the videos! Yeah -w works.
@ToxicRa1n42 жыл бұрын
any insight on how to package Selenium with this? Thanks!
@shanvantharunmozhi4 жыл бұрын
Dude use --windowed or -w Then it will hide the console. Or just use auto-py-to-exe...
@mikaelh95844 жыл бұрын
--noconsole also works
@mdzohaib73684 жыл бұрын
Sir i created a weather app which you shown in 24th video in your playlist but i did some changes adding images of cloud and other weathers but when i try to convert it to exe file its showing error. I think thats probably due to images of clouds and all. Can you tell me command to rectify it.
@wickedsnuk38126 ай бұрын
You are on windows right ? in mac it doesnt bring all the necessary files like this, I mean I cannot share it with others
@aklimaakterrimi38143 жыл бұрын
Hey elder.. i have done everything, instead of running my exe , it shows error 'unhandled exception' .. what should i do?
@joselatorre56673 жыл бұрын
I have a little problem, my app has images taken from an specific directory. If I want to distribute it, people would have to install these images too?. And if so... The python code takes the image from that specific directory, but for the client it would not be the same directory, so it would bring an error. Is there a way to get rid of this problem?
@Zhisaoka2 жыл бұрын
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding any help?
@Mirador12 жыл бұрын
Is it impossible to save information in an external file with these standalone files? Like settings, etc. I mean, like internally.
@adityarathi43124 жыл бұрын
As you have given argument --onefile just add --noconsole like pyinstaller.exe --noconsole --onefile it should remove the black screen.
@Codemycom4 жыл бұрын
yeah
@rogerperez9856 Жыл бұрын
Hello, I have created an app in Python which must connect to a database, but I want to extract the credentials from the code and make an executable to put it into production. The problem is that one way or another the user has access to the credentials, whether they put them in the code or include the .env file with the executable. Anyway, I don't know what to do to prevent users from having access to the credentials, I would like to know how I can do so that only the app has access to the credentials. Greetings.
@cyberdemon6672 жыл бұрын
My executables only work on the 64 bits version of Windows, how can I make executables for the 32 bits version?
@rakeshdhakshinamurthy77453 жыл бұрын
3:40 Thank me later. Excellent Instruction. Thanks a million
@Codemycom3 жыл бұрын
:-)
@kamisema Жыл бұрын
so what is the professional way to create an executable file ? if pyinstaller isn't the best way ?
@iftikharulmulk44053 жыл бұрын
Very helpful to me
@Codemycom3 жыл бұрын
Glad to hear!
@iftikharulmulk44053 жыл бұрын
Thanks for the reply. Bro
@Codemycom3 жыл бұрын
@@iftikharulmulk4405 sure thing
@Codemycom4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com Take $30 off with coupon code: youtube1
@007adityadwivedi4 жыл бұрын
Hi, I am trying same thing.. But when running in other machine still its again asking me for install modules which I have used in my exe. Please suggest
@nder47864 жыл бұрын
Awsome, helped me alot
@Codemycom4 жыл бұрын
Glad it helped!
@severinmarco Жыл бұрын
hi, is it possible to include an icon in the title bar so that when I create an executable .exe it is incorporated in it without having to carry it around every time? for example if I change pc?
@Codemycom Жыл бұрын
yes, check the docs.
@severinmarco Жыл бұрын
@@Codemycom Thanks for your quick response, I followed your video, the problem lies in the fact that when I create the executable file and move it to another PC, if the .ico file is not present, it also returns an error because it cannot find the path
@Codemycom Жыл бұрын
@@severinmarco exe are stand alone files. Read the docs to learn how to include your icon.
@matthewburton34694 жыл бұрын
Just wondering if firebase is supported by pyinstaller because I am struggling to try and convert my .py file with tkinter gcloud and smtplib into a .exe
@Codemycom4 жыл бұрын
No idea, sorry
@praveendesu Жыл бұрын
I installed pyinstaller successfully, but I'm getting this error when trying to convert a python file to .exe. Please help. 'pyinstaller' is not recognized as an internal or external command, operable program or batch file.
@Codemycom Жыл бұрын
Sounds like you didn't install pyinstaller correctly afterall
@davidstopponi75847 күн бұрын
Hola se puede crear un EXE de Tkinter con gracicos de matplotlib?
@bharaths13964 жыл бұрын
Hello Sir! Your content is Awesome... Here pyinstaller -h -F filename also works to avoid poping the black window Thank You Sir ,These videos help a lot.
@bharaths13964 жыл бұрын
-w not -h I am sorry
@haseebali81394 жыл бұрын
hey john I use this method to make an executable file of flashcard app and a flashcard.exe is made but when I run a cmd window pop up and after some seconds it closes showing something traceback type error and the actual file is not run yet
@Codemycom4 жыл бұрын
use the -w flag when you compile it
@NMISAKASHABHANDARY2 жыл бұрын
Wow Mr. White can cook and code as well 😆.(Breaking bad) Jk nice video thank you.
@Codemycom2 жыл бұрын
ha
@sundancekid903 жыл бұрын
Thanks for the video it was a huge help! Now I have made my executable is there a way to update it? I can't seem to find a way to make changes without deleting the exe and installing again with the new source code.
@x6Blade9x4 жыл бұрын
This application can be ran on a computer that hasn't installed Python and set the file path ?
@Codemycom4 жыл бұрын
yes
@aayushgupta69143 жыл бұрын
Now using both --windowed and --onefile flags the exe file as a virus!! Anyway to handle that and hide that popup command prompt??