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_ Жыл бұрын
NO in the pyinstaller just use --noconsole and no console will apear
@youzuko Жыл бұрын
@@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
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.
@RDKCREATIONS3 жыл бұрын
i have a json file in my project how can i do it
@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
@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!
@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 ;-)
@manigandandmx3 жыл бұрын
Bitdefender antivirus is detecting the stand alone EXE file as virus and keeps on removing it as soon I create it. Please advise.
@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.
@codegeassprogramming3 жыл бұрын
If we import other libraries the converted exe file do not have that libraries
@officialkeeto2 жыл бұрын
-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)
@ShashwataSaha3 жыл бұрын
What if my python project got multiple files linked with eachother?
@praveendesu2 жыл бұрын
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.
@Codemycom2 жыл бұрын
Sounds like you didn't install pyinstaller correctly afterall
@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?
@raghvendra874 жыл бұрын
Thank you Mr. White!
@Codemycom4 жыл бұрын
You bet
@subtemprodrigoes81643 жыл бұрын
It's Mr. Elder, what the hell?
@Zhisaoka3 жыл бұрын
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding any help?
@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!
@tomoyaokazaki99154 жыл бұрын
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
@carlosortega73633 жыл бұрын
My Command Prompt does not recognize "pip" install unless I am in the directory with pyinstaller. Is that how it's supposed to work? Its seems like in all of the examples they just run "pip install pyinstaller" from wherever.
@Codemycom3 жыл бұрын
No, you need to reinstall python. Click the "add python 3.9 to path" box during installation
@carlosortega73633 жыл бұрын
@@Codemycom That worked, thanks!
@adotac2 жыл бұрын
how will this work if my program needs to have atleast multiple scripts? do I just build from my main script?
@shakibrahatchowdhury6262 жыл бұрын
What would happen if the end user doesn't have all the dependencies available in their system? For example, someone downloads the exefile from internet and the user doesn't have phyton installed in the computer; what that still run?
@Codemycom2 жыл бұрын
yes
@christiankusi29744 жыл бұрын
need your help i created a exe file with pyinstaller but each time i open it close immediately but when i run it from the PyCham IDE it works. please help me convert it into an exe file
@Codemycom4 жыл бұрын
Sorry, I don't do pycharm
@Rshers2 жыл бұрын
How do i change the icon when using the -m (No console)?
@lemartien2500010 ай бұрын
Well, but if you have to add a database for example tree_crm.db to the exe..how can we proceed in pyinstaller ?
@Codemycom10 ай бұрын
I don't have videos on that
@cyberdemon6672 жыл бұрын
My executables only work on the 64 bits version of Windows, how can I make executables for the 32 bits version?
@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
@AdAstraCan3 жыл бұрын
I just signed up for the full membership. Thanks for making useful videos.
@nemithafernando57564 жыл бұрын
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
@Codemycom4 жыл бұрын
Windows defender blocks any apps it doesn't recognize, not just tkinter.
@apljs2 жыл бұрын
I'm struggling with installing pyinstall
@SabotageLuke4 жыл бұрын
I get this error: 'pyinstaller.exe' is not recognized as an internal or external command Please help!
@luinérion4 жыл бұрын
I guess you haven't installed it
@SabotageLuke4 жыл бұрын
Flash Learning I’ve installed it multiple times... I did pip install pyinstaller and it says it’s already installed. I tried it in admin cmd prompt and in normal cmd prompt
@luinérion4 жыл бұрын
@@SabotageLuke Try upgrading pip and then installing again
@Codemycom4 жыл бұрын
use the git bash terminal not the command prompt.
@SabotageLuke4 жыл бұрын
@@Codemycom Ok, I will try that. Thanks!
@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.
@x6Blade9x4 жыл бұрын
This application can be ran on a computer that hasn't installed Python and set the file path ?
@Codemycom4 жыл бұрын
yes
@khaledkhalaf18843 жыл бұрын
Hi, I come back and see this video because after creating the exe file the tkinter entry dont accept the paste shortcut why is that? and how can I fix it?
@Sharek3 жыл бұрын
Hi.. to fix the pop up window.../ pyinstaller myfile.py --onefile -w
@Iamzaidmnr4 жыл бұрын
wowwww! i just made my first executable file! Thanks.
@Codemycom4 жыл бұрын
Awesome!
@Codemycom3 жыл бұрын
@زاكي Zaky did you pip install it?
@peterviglietta42074 жыл бұрын
I used pyinstaller to compile my python tkinter program and it won't launch the tkinter window when I run it the executable. no errors upon compiling.
@Codemycom4 жыл бұрын
Weird
@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
@kamisema Жыл бұрын
so what is the professional way to create an executable file ? if pyinstaller isn't the best way ?
@nihalthannegedarapremaratn23523 жыл бұрын
if it is a big program (with dashboard and other..mysql), can we run like this..?
@unknowngalaxy78502 жыл бұрын
Thanks for this tutorial! Finally my school project has been completed. 🙂
@gaurideshpande37413 жыл бұрын
I have a machine learning project where I have ised svm.svc and a some GUI ,also this project needs dataset....can I convert it to .exe file?
@Codemycom3 жыл бұрын
Give it a try and see
@gaurideshpande37413 жыл бұрын
@@Codemycom thanks
@AyanKhan-dc3eu4 жыл бұрын
Help me please it's showing Fatal error: python does not have a pre complied bootloader for your platform. When i googled about it they are suggesting to make your own one I don't actually get there procedures. I'm just a beginner.
@Codemycom4 жыл бұрын
I have no idea what's going on there. What's the exact error?
@AyanKhan-dc3eu4 жыл бұрын
Fatal error: PyInstaller does not include a pre-compiled bootloader for your platform. For more details and instructions how to build the bootloader see
@AyanKhan-dc3eu4 жыл бұрын
Well i figured out that it is due to bit version difference between system and python. I will install python 64bit then let you know if it solves my prob. Thanks for replying 😊
@aklimaakterrimi38143 жыл бұрын
Hey elder.. i have done everything, instead of running my exe , it shows error 'unhandled exception' .. what should i do?
@shubhanshusharma53723 жыл бұрын
How to add font using pyintaller
@vicesodan3 жыл бұрын
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
@nightstarproductions144017 күн бұрын
i cant get my exe file to run any solutions?
@aayushgupta69143 жыл бұрын
Now using both --windowed and --onefile flags the exe file as a virus!! Anyway to handle that and hide that popup command prompt??
@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.
@Spring-04 жыл бұрын
When I type pyinstaller or pyinstaller.exe it says not recognized as a internal or external command. But when I do “py -m pip install pyinstaller” it says it’s already installed
@Codemycom4 жыл бұрын
weird
@TechWithAminjon3 жыл бұрын
Hello
@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!
@RameshAkula3 жыл бұрын
Getting this error while converting into executable file in mac OS: Traceback (most recent call last): File "/usr/local/bin/pyinstaller", line 6, in from PyInstaller.__main__ import run File "/usr/local/lib/python3.7/site-packages/PyInstaller/__init__.py", line 45, in import pkg_resources File "/usr/local/lib/python3.7/site-packages/pkg_resources.py", line 1479, in register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider) AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader' (base)
@a.svasial8844 жыл бұрын
fatal error detected failed to execute script pyi_rth_pkgres.... When I open the exe showing this please help me
@Codemycom4 жыл бұрын
Try googling the error...
@a.svasial8844 жыл бұрын
@@Codemycom bro only 2 videos related to this error I tried but for me its not working.... They saying if there an dependency or image need to copy to the project location... How to get the dependency?
@MegaDixen4 жыл бұрын
@@a.svasial884 I have the same problem when i run the exe file
@quentingourier48834 жыл бұрын
@@MegaDixen i solved the problem, you just have to put "--hidden-import="pkg_resources.py2_warn" between "pyinstaller" and "--onefile" in the cmd
@sammiyin35164 жыл бұрын
@@quentingourier4883 Thanks! That fixed it!
@CodeWithSamarthJ Жыл бұрын
Can someone help as I have already downloaded but the file open and closes in a second .So how do i fix it?
@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?
@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'
@aneeshprince63004 жыл бұрын
What could be the potential reason if the app doesnt work in other windows machines...like i am getting fatal error if opened in other device
@Codemycom4 жыл бұрын
Sorry, I don't know
@flaviomonteiro14143 жыл бұрын
Hey I do belive adding --noconsole when generating the .exe does remove the black console window... I do not tested yet on a computer without python installed but if works let me know!
@Codemycom3 жыл бұрын
yep
@MRL2909753 жыл бұрын
my pyinstaller executable takes a long time to open... how can i speed it up?
@Codemycom3 жыл бұрын
no idea
@Ev-0018 ай бұрын
Do you have a video of how to compile multiple .py into an exe, I also am using CTk as well. I tried pyinstaller but its missing dependencies
@Codemycom8 ай бұрын
no
@Ev-0018 ай бұрын
@@Codemycom ended figuring it out with pyinstaller =)
@elysonpanolino11622 жыл бұрын
Is there a way that I can do this even deleting the image file?
@Lweirday3 жыл бұрын
what should i do and how to use pyinstaller if i have one python file and one folder contain database and other folder contain images??????
@pragyanprabhu35132 жыл бұрын
I get an error saying no usable temp directory found
@zadfcer4 жыл бұрын
I created a simple program program.py print ('Hello world!') I used pyinstaller --onefile program.py when I double click it does not open or appear in the task manager
@zadfcer4 жыл бұрын
i have installed Python 3.7.2
@Codemycom4 жыл бұрын
No clue dude.
@Xreactives4 жыл бұрын
I think it appears but disappears in a very high speed because the program doesn't loops, or maybe u can try to import time and then put time.sleep(8) to let it have a delay of 8 seconds before it closes it's console
@ayeshasiddiquea91594 жыл бұрын
How to do 3 frames using python tkinter mini project of advertising agency which consists of registration form...
@Codemycom4 жыл бұрын
Yeah I don't know what that is..but you can see how to do all of those things in the various videos in my playlist
@alfoxgamer4 жыл бұрын
Does someone know to how to sign the .exe , because I send test files to my friends to beta test and in other computers my program starts SmartScreen of windows or Avast, so i think it might seem like a virus to their computers.
@mariohart70174 жыл бұрын
Same
@techwithdavid064 жыл бұрын
Hey I don't know if pyinstaller works on python 3.6 because I'm getting an error when I try to pip install pyinstaller
@Codemycom4 жыл бұрын
it should
@mukulM20104 жыл бұрын
Hey I'm getting the "File not defined" or "File not found" error as I have images and sounds in my python code. How do set the file path of these images in my python code so that the executable works on any other computer?
@Codemycom4 жыл бұрын
Use absolute path's In your code, instead of 'file.mp3' type 'c:/whatever/file.mp3' ?
@uninho19853 жыл бұрын
How can I do that when I use a tkinter GUI and selenium with a dir "User Profile" for my chrome profile? I keep getting the error "failed to executescript". I tried adding the folder, I tried adding it manually after compiling the .py file to .exe and so on. Nothing worked for me. Any tip?
@Codemycom3 жыл бұрын
sorry I don’t use selenium so I couldn’t say
@manakwadhwa4 жыл бұрын
I have a main.py file it has a dependency new.py and new.py has another dependencies when i run pyinstaller on main.py it makes exe for main.exe only and for other dependencies it is poping up a terminal and not showing anything can you help.
@Codemycom4 жыл бұрын
Yeah pyinstaller is a little shaky
@RaviKumar-TPN2 жыл бұрын
Bro how to show the video output of the another program in a GUI window
@shayshay82954 жыл бұрын
Where do i write those commands while using PyCharm? And when i try to install the pyinstaller i get this error: SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf9 in position 0: invalid start byte (sitecustomize.py, line 7)
@Codemycom4 жыл бұрын
No idea, I would never use pycharm. Use sublime text and git bash terminal git-scm.com they're free and actually work
@arnavpandey17224 жыл бұрын
Bro,if you have an error in installing pyinstaller than install it from python unofficial binaries and if you type in cmd if you are using windows pip install pyinstaller it would work after a restart of pycharm.
@ToxicRa1n42 жыл бұрын
any insight on how to package Selenium with this? Thanks!
@sonamtshering3817 Жыл бұрын
how to create a document based desktop application with its own file extension just like other document editing software like word
@Alinear2854 жыл бұрын
I get a winerror that says that he is not allowed to access the folder. How do you fix this?
@Codemycom4 жыл бұрын
without knowing the exact error, I can't say. You can always google the error.
@icodeint27803 жыл бұрын
I did all, but when I click on the exe, I have the console only the poo open, then shut off after seconds, I have tkinter and other modules used
@JS-ik4kb4 жыл бұрын
does user need to install phyton at thier end or they can use it as a desktop application without installing phyton?
@naxdax1004 жыл бұрын
they wont need to install python
@holycow48894 жыл бұрын
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 :)
@soham72264 жыл бұрын
My .exe file closes immediately. What to do?
@harshithad8014 жыл бұрын
Same problem
@Mirador12 жыл бұрын
Is it impossible to save information in an external file with these standalone files? Like settings, etc. I mean, like internally.
@shubhamchidrewar4767 Жыл бұрын
I am getting Invalid syntax error. not sure why this is happening
@tishaanants3 жыл бұрын
Which method do u prefer for creating a standalone exe
@gurarkin3313 жыл бұрын
I used the method but when I opened the exe file the program didn't work, do you know why?
@Codemycom3 жыл бұрын
no
@ferasfm2 жыл бұрын
Hello, I talked about a better way to convert Python, especially if the project is a lot and has a lot of files and links to Python. Can you write me the best way to convert the project into a Windows program format
@Codemycom2 жыл бұрын
No, there is no best way. It always depends on the app and what you need it to do.
@xith-eb1jeevanraj.l4858 ай бұрын
Sir ,I can't access the e.get ,it show nonetype attribute error
@Codemycom8 ай бұрын
Did you define the widget and pack it all on the same line? You can't do that...
@cesaryoshikawa76564 жыл бұрын
my .exe file simply doesn't open. No error message even if I use cmd to open it. I sent the file to a friend and he could open it. I think it is related to my Windows. Any suggestions?
@vikas_katla3 жыл бұрын
its due to icon u added to ur program or the path you mentioned in your code
@nellaimuthuvels70993 жыл бұрын
IT works on my machine not on another, how to write script that runs on macihine depending on the windows
@Codemycom3 жыл бұрын
exe files are supposed to work on other machines, that's the point of them.
@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?
@swat99G Жыл бұрын
Hello world. If for my code to run I need to pip install a librady (ex. pip install GoogleNews) , will someone else in a different pc with no python installed could run the exe?
@Codemycom Жыл бұрын
The exe should bundle up all the neccessary libraries and install them on the users computer.
@swat99G Жыл бұрын
@@Codemycom Thank you!
@wickedsnuk38128 ай бұрын
You are on windows right ? in mac it doesnt bring all the necessary files like this, I mean I cannot share it with others
@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
@tobias26884 жыл бұрын
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
@msai30123 жыл бұрын
How to make exe file if i have database?? how can i include db to the end user?/
@TechWithAminjon3 жыл бұрын
Hello, after converting the python file to exe format, if I enter the program, there is a tkinter icon. Is it possible to delete it or can I add another image?
@Codemycom3 жыл бұрын
don't we add another image in the video?
@TechWithAminjon3 жыл бұрын
Hello, thanks for the reply but i was asking for something else.
@TechWithAminjon3 жыл бұрын
For example, I made an exe program of a program I wrote in python, I put a picture in the zancho on the man, but when I enter the program, in the upper left part of the program, the tkinter icon is not lost.
@vanshatcode4 жыл бұрын
i am unable to download pyinstaller : (
@sanjayrajasreeraja34564 жыл бұрын
plz John can u update this video with the black thing not opening?
@Codemycom4 жыл бұрын
No, just use the -w flag like all the comments say, when creating the exe file.
@shehab9764 жыл бұрын
i tried and made a executive exe file of .py(uses pandas modules and having file handling) file but didn't work when executed .exe file,it said no modules found named pandas...but from spyder the program runs successfully
@ahmadadamjj47622 жыл бұрын
I have similar issue today, I came across your question. Please are you able to resolve the issue? if Yes, how?
@shehab9762 жыл бұрын
@@ahmadadamjj4762 its solved,install pandas on cmd or open anaconda command prompt if available
@ahmadadamjj47622 жыл бұрын
@@shehab976 sorry but I'm using pycharm IDE, where I have installed all the libraries my prpgram needs to run and it's working so ok. While after packaging and form the .exe it shows that face_recognition module is not installed.
@shehab9762 жыл бұрын
@@ahmadadamjj4762 try have that. py module file in the same directory of your exe then run