Convert PY to EXE
HTML-код
- Опубликовано: 6 дек 2016
- This video demonstrates how to convert .py to .exe so you can run a python script without python on the host computer using pyinstaller. This video will show you how to set up pip, install pyinstaller and compile a script a few different ways including; one file, no console and adding an icon.
Currently, Python 3.5 - 3.10 is supported.
🌎 Post with code and a written tutorial: nitratine.net/blog/post/conver...
📺 Python Keylogger: • Simulate Key Presses i...
📺 How to setup pip: • How to Setup Pythons PIP
📺 Auto Py to Exe: • Convert PY to EXE Auto...
🌎 Icons: goo.gl/EfpGD0
Correction: 2:49 - Was meant to say it did have an icon
Also Microsoft has replaced cmd with PowerShell in Windows; PowerShell will do the same task just as fine.
🐍 In this video I use Python 3.5.
👍🏼 Feel free to comment with any issues.
2:51 mins of pure gold information. every single yt tutorial should be like this. MVP
Haha, glad you enjoyed it!
@@PyTutorials Guy,
You were the first tutorial I watched about it.
It was freakin' working first time ! haha
Last time I've watched a Python tutorial about pip, it tooks me 20 minutes to figure it out.
But now I have a question. If I want to share this .exe . I must share all files ??
Edit : ( I put -F -w )
Everything in the \dist folder is what you need. If you used -F, then there should be only one executable in the dist folder. "dist" stands for distribution.
@@PyTutorials Ha. And should the reciever have the Python ?
No, the whole point of packaging scripts into executables is so you don't need Python on the host.
This is a tutorial made perfectly. Someone make this man king of the internet.
Liked
when i shift+right click i get powershell rather than command prompt
powershell also works
I totally agree!
This actually made me laugh, and yes, i agree!
This is genuinely one of the best tutorials I have seen. You speak at a great pace, you are knowledgeable of the subject, you give quick, precise, and yet detailed information. I learned all I needed to know to create an executable in just three minutes. Absolutely amazing, genuinely. Thank you.
Thanks man! Glad you liked the format 👍
That is what a tutorial should be like. I have been searching the web for the past hour and you summed it all up in just under 3 minutes. Great job and keep it up!
Glad you enjoyed it!
Great Tutorial. Concise and to the point. The world needs more like you!
Glad you enjoyed it!
I'm a simple man. I watch a good tutorial, i give it a like.
This is what I've been looking for.
Keep up the good work and thanks for such a great tutorial brother !
Glad you enjoyed it!
Hey just wanted to say thank you for this. Around 6 yrs ago, I was a junior software engineer working on a tool for our main app, this tutorial saved me from hours to days of headache. Thank you so much! Keep up the good work wherever you are.
Thank you for this wholesome comment. It warmed my heart 😃
Perfect, straight to the point. And no 5 minute introductions
Glad you liked it!
This is like the best python video I've seen yet and it's not even 3 minutes long.
I'm glad you liked it!
Man, i want to thank you for your super, easy and simple tutorial, after hundreds of websites and videos, i found the perfect tutorial ;)
Thank you again ;)
You dont know how much I've been looking for this video. I wish you all success my dude. You've helped a miserable guy here!!
Haha, I'm glad it was useful for you!
wow it actually really works
for me eve pip installations were a big problem
this has changed allot
:)
I'm glad you got it working 👍
No bullshit, to the point fast. Thanks you sir!
Glad you enjoyed it!
What? This is amazing quality, very dense yet very didactic, easy to follow thanks to the command appearing on screen. I wish I had found your channel before but I am very appreciative to have found it today. Thank you. FIrst video, immediate like and sub. You are amazing!
Thanks heaps for this comment! I'm glad you like the videos.
wow I'm impressed by this high quality, straight forward tutorial! keep making these videos!
Thanks man!
The last part about the icon was really helpful thanks 😂
Glad you got some use out of the video!
You also taught me how to install modules to python thank you sir
Awesome tutorial! Thank you for making it so clear and concise. Keep on making them!
Glad you enjoyed it!
Perfection at it's finest, perfectly executed, nicely understood. Good Job Brother..!
Glad you enjoyed it!
Woow never seen something that was so fast and very good
Thx to you I could do it
Continue like that dude :)
I'm glad you like the format!
Thank you so much for the tutorial and the program.
Glad you enjoyed it!
Thanks a lot, finally someine making it clear.
Every tutorial is like "use this command" but they don't show in what I was supposed to use it, and none of the other tutorials I saw did the first thing with the path.
I've been struggling with this so much, now it finally works! :D
Great work sir, very usable for me. explain really nicely in just less then 3 mins!! Thank You v much for this quick tutorial.
I'm glad you liked it!
Excellent! I can now compile things much more easily and more efficiently. (Better than CX Freeze)
Much better than ex freeze
+PyTutorials I know right thanks man
Short but very informative, thank you.
Thanks a lot for the easy and simple tutorial. Thanks a lot! Clarified a lot of doubts.
ГОСПАДИ ЕДИНСТВЕННЫЙ НОРМАЛЬНЫЙ УРОК НА Ю ТЮБЕ!!! СПАСИБО thank you!!!
jesus the only sensible tutorial on youtube!!! thank you!!! is what it translates to
agreed comrade, agreed
Не устанавливается Pyinstaller....Как решить???
What errors appeared when you executed "pip install pyinstaller"?
it says that pip is not an internal, external, operable, or batch file
For everyone who have problem with installation and pip problem. When you set up 'Path' *just add in the end \*
This is by far the best .Py to .exe tutorial on the platform I really appreciate the fact that you show us how to add the icon and remove the additional files and the console. Thank you very much!
Cheers! Glad you found it useful 👍
Very thanks to you. This is the only simple and nice video about pyinstaller
Finally a tutorial that works. Also how do i make it if my program depends on files such as .pngs it will also compile the png into the exe, so it can run without having to be in the same directory as the image
If you go to ruclips.net/video/6LC3SV7yTLY/видео.html and watch from 3:25, I show you how to compile the image into the executable. Make sure to add the code to your script and wrap it around all usages of the image in the script. If you follow along correctly it should work. Has never failed for me.
I have a version 3.5.2 of Python and he is installed in AppData...local?
What's the issue here? If it's adding the scripts folder, then use the scripts folder from python in appdata? No brainer really.
When i want to create a new path for my directory this window is not the same in Windows 7 at all,it offers me to add variable name and bellow variable value.
Ah, you are correct. Add a semicolon to the end of the current path that comes up (';') and then put the directory after that and save it.
Would this be runnable by someone I sent it to without Python?
Also nice tutorial. The pace is perfect : )
Yes
Just perfect! Straight to the point, usefull, just what we all needed!
Glad you found it useful!
works great, thank you. been looking for 2 days to try and do this :). now i just need to learn how to do some more programming. thanks again
Glad you enjoyed it!
You're the best!!
I'm glad you enjoyed it!
WoW amazing
Quick and perfect. Thank you!
Thank you for the simple but amazingly brilliant tutorial. You were the first person that made it so easy to converting a py to exe.
Glad you enjoyed this! I have anther video coming out soon that covers an interface I built to convert py to exe easier
Me: Wow I just compiled my first executive program! I am so excited!!
AVG: I 'm gona end this guy's whole career! >:-(
Also AVG: Threat Secured. We've moved myprogram.exe to your quarantine because it is infected!
Unfortunately, some anti-virus vendors think that the output is a virus/malware. It has been noted in a GitHub issue but unfortunately, this one is on the vendor and there is nothing we can do: github.com/pyinstaller/pyinstaller/issues/2501#issuecomment-286230354
@@PyTutorials But windows defender also detects the exe file as suspicious
Windows defender is a form of anti-virus software, so my answer will be the same as if it were AVG/ESET/ect..
Thank you so much!! :) I love your tutorials!
I have a question
After I convert to .exe how to run automatically when windows starts up? Sorry for my english. Thanks!
Put the file or a shortcut to the file in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
unfortunately I tried it and, on windows 8.1, I have error at start. I put the shortcut on that folder, and all the executable on "C:\Program Files", the logs are saved on a public folder, so there aren't privileges issues. Nothing works, every time at starts it pops up "failed to launch coco.py".
They asked how to run an .exe automatically when windows starts up, not a .py. By the looks of the error you have put there, you have put a .py file in the startup folder. To run the .py you will need to have a .bat file in the startup folder calling "python " and then your python file some where else (no in the startup folder).
Ye, I mean, the shortcut refers to the .exe file on the folder under "C:\Program Files".
I was wrong, the error refers to the executable, not the py file, since i made the executable using the .pyw file
Does the .exe run when you run it manually?
man, thanks so much for this. Respect from Sydney!
Glad it helped!
i literlarly just choosed this tutorial because its very short and i dont want an ytber who just talks soooo much and doesnt cae to the point, but this was the greatest i could found. Thank you!
I'm glad you liked it 👌
If the console write the AttributeError: module 'enum' has no attribute 'IntFlag', then in the console write pip uninstall enum34 (I useing Python 3.6)
Wow, is that really a fix?
😂 you weren't even tryna hide it, you turned the keylogger into an exe to send it to victims 😆
Na, I just turned it into an exe for a demo but good spotting
The best tutorial ever. This guys the best, even after 5 years he's helping out people who face problems while converting the file. He helped me alot, he deserves the subs. You're underated af. Massive respect 👍
Cheers man 👌
very good video, thank you, hung on this for more than a week, until I saw your tutorial
Glad you enjoyed it! Getting into this sort of stuff for the first time can be confusing.
is it available in Walmart?????
Probs not soz
Ha
pyinstaller is creating an empty Dist folder!! Why!!?
Is there any way to solve this??
Are you looking at the output? There will most likely be errors at the end that you are ignoring.
Yupp
I used "cx_freeze" and it works
@@vatsalmewada1389 how i have the same problem
romu edorh have you installed qpython?
Bro explaned this much in only 3 minuts, you are a legend
Efficient explanation. Works great. Thank you very much.
Great to hear!
Traceback (most recent call last):
File "", line 1, in
import pynput
ImportError: No module named 'pynput'
Try reinstalling pynput
Did it work for you ? Because I have the same problem wtih the library named PIL and I'd like to know how to solve it
@@gianni16 No idea man I don't remember
For PIL, if you are using Python 3, you will want to install "Pillow" using "python -m pip install Pillow"
спасибо
Awesome tutorial man! I was reading documentation for hours and didn't get this far!
Glad you enjoyed it!
This guy summed up 10-minutes of other youtuber talks in 2:51. No more none sense, straight on point.
thanks
sorry for my english
Suharsh Tyagi 😂😂😂😂
lmao
😭👏🏻👏🏻👏🏻👏🏻
sjhdfbhjsdbfjsdbfjh :D aynen mq benimde asdasıodasd :D
@Rusty TNT what, i dont understand
C:\Users\username\Downloads\Compressed>pyinstaller file_name.py
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.
Did you install pyinstaller like I showed in the video? Or did you just skip it or ignore errors?
PyTutorials old as hell but the reason it doesn't work is Windows 7 CMD. Trying to figure out the prefix to use here myself (ie instead of "pip" you use "py -m pip")
Hey, thank you for this guide.
Worked as intended.
Awesome!
Well explained and also answering the comments. Thanks, man.
Glad you found it useful!
Indexerror: tuple index out of range =/ =(
At what time is your error appearing?
1:25 pyinstaller pythonfile
And all created folders(dist and build) are empty
I can't fix this unless I actually see the problem. I'm no magician.
Do you have facebook or email, I could send you the image of the error if it is not busy
pyinstaller --onefile --hidden-import tkinter myscript.py for use with tkinter!
Please explain how to input it correctly
There are spaces in between "pyinstaller --onefile --hidden-import" which I didn't notice. And now there is another problem - Python 3.7 is not supported by pyinstaller :( Found on github.com/pyinstaller/pyinstaller/issues/3219#event-1812488416
You are correct, I have also noted this support issue in the description clearly.
I also had this problem when i started programming, so i just saved my file, and then uninstalled python3.7, i then downloaded 3.6 instead
This is how a tech tutorial should be. I've literally seen people make 10 minute tutorials to explain something that could have been summed up in 30 seconds, I am not even kidding.
Thanks man. I rather this format also as you lose less time but there seem to be quite a few people that hate the speed.
Thank god someone that actually cares about making quality content. Not often one can say that these days. First video I watched from you was how to make an auto clicker! all of your videos are short and to the point! defo deserves a sub
I'm glad you like the format!
This is what you call an amazing tutorial. Thanks
Glad you enjoyed it!
Thanks, bro, this is really helpful.
few minutes! great explanation! THANK YOU!!
Glad it was helpful!
your tutorial video has helped a lot to me and others. thank u very much sir and keep it up
Great , thank you for making this finally i did it! thank you very much
This is amazing, thanks for the straight forward video!!!
I'm glad you found it useful!
Thank you for this wonderful, straight to the point tutorial.
Edit: Subbed
Thanks man!
Excellent video!! Direct, to the point and very clear!
Cheers!
PURE GOLD, THANKS MAN
Thanks a lot. It worked for me. Great tutorial.
Glad you enjoyed it and got it to work with no error!
Very nice video! It's so hard to find a good tutorial on this and you just explained it super easy.
One more small tip: I program at work and I don't have admin rights so I cannot add a path like shown. If anyone else has this problem: you can just open cmd and manually go to the scripts folder with the 'cd' command and pip install will work just the same.
I'm glad you liked it! Also that tip is very helpful, a lot of people that watch these videos don't understand little tricks like that (or even absolute references)
Thanks for answering on my comment. I'm actually really new to python, started a few weeks ago with this guide: automatetheboringstuff.com/, it's really great.
But now I have the chance to ask you I have one question: I often come across tutorials that use 'python' as a command in cmd, but that doesn't work for me and when I look for a solution it says I need to add the path (which I can't), but it also doesn't work when I manually go to the path as I described. Is there any way to make it work without having admin rights?
Oh wait I just realised that was kind of a stupid question. Python probably isn't a command but it just launches python.exe and I think my command line was in the scripts directory for pip but python.exe isn't there so... I'll check it tomorrow but I think I just figured it out.
When using cmd, you can cd to where your python instillation is located. Make your current working directory the same as where python.exe is located. Now you can simply call ./python.exe
Thanks for this video, I needed to eliminate a big problem
Thx a lot for this tutorial, help to figure out how it work !
U saved my brains 8)
Glad it helped! A while ago I made a automatic converter and put it on Github at github.com/brentvollebregt/auto-py-to-exe. If it sounds interesting check it out!
Straight to the point. Love ya
Glad you enjoyed it!
LOVE IT. Great video. Hate people who take 10 minutes to get to the actual point of the video. You are not one of those people :) Very easy to follow. Took some notes for future reference, lol ;)
Cheers, glad you found it useful!
Clear and concise. Kudos!
Cheers!
Hi. When using special plugins like "PyGame" and import stuff, do you have to convert them aswell? Will scripts not work without it? for example, if i did "import pygame" and i converted the file and i made it so others could download it, what if the others dont have pygame? or python itself? How do i make sure users can run this even when they dont have pygame, or am i overspeculating and it might already come with pygame?
Pyinstaller will look for declared imports and add them to the output package. Once you have packaged the script with pyinstaller, the host machine will not need pygame or Python installed. You need to remember to add files that aren't .py files though like images and data files.
"How do i make sure users can run this even when they dont have pygame" - The platform you build it on will be the supported platform that the executable can run on (including architecture - x64 won't run on x32 but x32 will run on x64).
Thank you very much!!!! It has been a great help to me
Thanks a lot. Keep doing the great work!!
Glad you found the tutorial useful!
I don't really need this information right now, as I can't even make my software work properly, but God damn a nice tutoral. One of the few where the comments aren't lying. Short and concise and full of all the information you'd wanna know. Just goes to show that you don't have to make 10-20 minute videos about a topic.
Cheers!
Great Tutorial!
Very good, helped a lot, thx!!
Thank you so much. I bounced between py2exe and cx_Freeze before finding this lifesaving video!
Glad you found it useful!
Thank you very much for your good and very useful lesson. It have really helped me a lot , because I watched a lot of videos for 2 months , and they didn't help me )
Thank you for a very good informational video. Straight to the point.
Glad you liked the format!
Thank you! Straight to the point.
I'm glad you liked it 👌
Outstanding tutorial, thanks for this.
Glad you enjoyed it!
Thank you really man, I really needed this help
I'm glad you found it useful 👍
thank you very much, this video helped me a lot
Thank you!!! Pyinstaller the best
What a precise video. I have referenced to this atleast twice now :)
I'm glad it has been useful!
bro you made my life easy , I made a tcp reverse shell in python, and wanted to change it into an exe file, I couldn't for hours, after watching your tutorial i was able to turn the script into a single executable file.
I'm glad the tutorial was helpful!
@@PyTutorials yeah i subscribed good tutorial
Thank you! best tutorials
Great Video ... thanks a lot for posting 🙏🏻
Glad you enjoyed it!
Excellent, legend, be my teacher, what a man
The tutorial was very amazing and helpfull!!!!
Thank you very much for sharing such knowledge!!!
I'm glad you found it helpful 👍