Creating a Stand Alone Executable from a Python Script using PyInstaller

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024

Комментарии • 197

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  5 лет назад +7

    Full Python Programming Course. ruclips.net/video/bZ6NL59FMoc/видео.html

    • @peterlandyn6821
      @peterlandyn6821 3 года назад

      i realize I am pretty off topic but does anybody know of a good place to stream newly released tv shows online?

    • @reignben2284
      @reignben2284 3 года назад

      @Peter Landyn i watch on Flixzone. You can find it on google :)

  • @JuanCarlos611
    @JuanCarlos611 4 года назад +27

    If you already have pip, jump to 3:45

  • @xxjaydog71xx
    @xxjaydog71xx 5 лет назад +10

    I REALLLLLY appreciate this. I've been trying figure this out for a while now.

  • @learningtho582
    @learningtho582 2 года назад +2

    Oh god you are amazing! I watched 5 other videos and none of them solved my problem. THANK YOU!

  • @kilthy7832
    @kilthy7832 2 года назад +3

    Very helpful, concise and presented tutorial. One bit of feedback from me: It would have been very helpful to see your raw python script code. Even though I can tell the script is a simple print script, not knowing if you had any imports or not for this particular example left me with more questions that should have been given how excellent you are at teaching. As always, very thankful for your lessons!

  • @BJCP
    @BJCP 4 года назад +6

    Tip for opening cmd prompt from windows explorer. Type CMD in the directory path and hit enter. It will open a cmd prompt in side the current working dir.

    • @qureshizaid
      @qureshizaid 2 года назад +1

      wow. you made my life easier

    • @BJCP
      @BJCP 2 года назад +1

      @@qureshizaid glad someone found it useful 🙂

  • @pfever
    @pfever 4 года назад +53

    PIP! ..... PIP! .............. PIP! ...... PIP!

  • @rosjio99
    @rosjio99 4 года назад +18

    8:48 Can you share the code for your tkinter application? I’d love to see how you applied style to the form.

  • @sergiopalazzi6033
    @sergiopalazzi6033 Год назад +1

    Thank you very much: your explanation is REALLY clear. Thanks to your explanation I solved my problem with this issue! Great job!!!!

  • @DanBrill
    @DanBrill 4 года назад +7

    Thanks! Lots of time on my hands as the world is currently quarantined. I just started learning Python this morning. This was really helpful!

  • @MatthewNew
    @MatthewNew 3 года назад +2

    I got an error that said "script 'C:\My_File' not found."

  • @whoozy1555
    @whoozy1555 4 года назад +2

    Man I love your Videos! You can explain everything so perfectly an understandable! You are helping me with every problem! I love your channel

  • @anokhautomation4453
    @anokhautomation4453 3 года назад

    This is the tutorial i was looking since a long time.because i have many python project to covert exe file.
    I am appreciating you a lot 🙏🙏. Thanks for sharing and a deep explanation 👌👌👍👍.

  • @muokinzangi3067
    @muokinzangi3067 3 года назад +4

    what if you need your client to install in both windows, linux and macOS. what do you do?

    • @Tovin
      @Tovin 2 года назад

      PyInstaller will auto-create the executable program for the operating system you are currently on. A workaround for this if you do not have a Mac and PC would be to run python on a virtual machine whenever you need to create an additional package for another OS

  • @landrhykopp9836
    @landrhykopp9836 2 года назад +1

    Thank you a lot.Excellent tutorial.

  • @BimmerWon
    @BimmerWon 2 года назад +1

    Thanks. I’m gonna make some programs now and run them on my work computer to make my job easier and less tedious. Hopefully I won’t get in trouble lmao.

  • @joliver1981
    @joliver1981 5 лет назад +3

    Great tutorial. Always wondered how this could be done. Thanks!

  • @tolkien11
    @tolkien11 4 года назад +1

    Just what i was looking for. This is awesome. Thanks a lot!

  • @MasterHaz
    @MasterHaz 3 года назад

    Thank you so much! I just made my first ever application with your help, and im so stoked!!!

  • @vidatamas6092
    @vidatamas6092 2 года назад

    Thank u so much this was really helpful for me

  • @parvgour5284
    @parvgour5284 3 года назад +1

    Thanks for sharing...

  • @ahmetselimhansahin9643
    @ahmetselimhansahin9643 2 года назад

    It was really helpful mate , thank you for your great explanations !!!

  • @BimmerWon
    @BimmerWon 2 года назад +1

    I’m new to python and programming in general so what’s the point of NSIS? Is it for website downloads of the program? Can’t I just email myself the .exe file and run it on another computer?

  • @marzantasnimoyshi441
    @marzantasnimoyshi441 3 года назад

    Thank you so much for making this video. really appreciate it!

  • @shawnarmstrong3339
    @shawnarmstrong3339 3 года назад +2

    Are there extra steps involved when creating an executable with a script that interacts with additional files?
    I tried making an executable of your OpenCV Python video 21. The executable doesn't display any of the images.

    • @bpi2070
      @bpi2070 3 года назад

      Which additional files ? Do you mean for example photos, icons or databases files ... that are in some specific folder and you are using their paths in your code ?

  • @gabrielgoncalvesazevedo9114
    @gabrielgoncalvesazevedo9114 4 года назад +3

    Hey, Im having a problem here, my executables doesn't compile with the modules imports, what do I do?

    • @tibiboy1226
      @tibiboy1226 4 года назад

      same problem here...

    • @fuzbalPob
      @fuzbalPob 4 года назад

      @@tibiboy1226 same here... any idea?

  • @akhilap9652
    @akhilap9652 4 года назад

    Well explained.... Thanks u made it simple

  • @JoshuaWayt
    @JoshuaWayt 3 года назад

    This was incredibly helpful thank you!!

  • @RonyEfendy
    @RonyEfendy 4 года назад +1

    It works but all images and icons do not appear on my app.

  • @Tommy_007
    @Tommy_007 2 года назад

    Very good video! Just one question: What is the pyintaller command when one's python project consists of more than one file (.py files and maybe other kinds of files)?

  • @MouseGoat
    @MouseGoat 2 года назад

    Thanks cool this worked so well :D

  • @CBQReview
    @CBQReview 3 года назад

    Youre a life saver. Thank You!

  • @muhammadsultanularafin8846
    @muhammadsultanularafin8846 4 года назад +2

    Marvelous tutorial! Appreciate it. Like to know one thing, how to include virtual environment folder in pyinstaller?

  • @wanderingknight10
    @wanderingknight10 3 года назад

    Thank you..very well explained

  • @sarmadalrubaye8251
    @sarmadalrubaye8251 3 года назад

    Hello,
    first I would like to thank you for this usefull video,
    second I want to put my equestions regarding to this topic "Pyinstaller",
    I have developt a script and this script import many function from other scripts,
    the problems are:
    1- I have to put all dependencies script together with the exe file in the same dist folder to run.
    2- the exe file doesn't run without install Python in the pc that I use it to run the exe file.
    3- if I use any module like PYQT5 in my script I need to installed in the python.
    so I see Pyinstaller generate non standalone exe file.
    what is the suitable method that can I use to generate 100% standalone exe file without need to install any thing else ??

  • @gids522
    @gids522 4 года назад

    Extremely useful, thank you!

  • @bottonline4544
    @bottonline4544 4 года назад +3

    Hi, when executing the instruction , i get an error: " Type error : an integer is required (got type type bytes )"
    my instalation is pip 19.3.1 Pyton 3.8 ?? regards

    • @poorpantoufle8347
      @poorpantoufle8347 4 года назад +3

      Same for me, apparently it's because pyinstaller's last update is for python 3.5. I have installed the last version with "pip install github.com/pyinstaller/pyinstaller/archive/develop.tar.gz" via command prompt and it's working now :)

    • @karldavidson8843
      @karldavidson8843 4 года назад +1

      @@poorpantoufle8347 Can confirm, this works. I still get some other errors, but I guess they don't matter.

  • @deeepzzz
    @deeepzzz 3 года назад

    Useful information. But I didn't liked the last part (not about you), that we need to use "that" same operating system to create installer.. which is a bad idea actually (I should able to create installer for windows, linux and mac from my windows machine itself)

  • @nemanjamarkovic9818
    @nemanjamarkovic9818 4 года назад

    Finaly works, ty so much, u got yourself subscriber and like

  • @rahelly84
    @rahelly84 4 года назад +1

    if i call other Python members from my executable program it wont work, how can i make it work? using Pycharm

  • @MrSantoshKm
    @MrSantoshKm 5 лет назад +1

    Hi. I created one tkinter project and converted into .exe with same method, but this file size is 320MB. Is there any way so I can reduce this file size. I am using these libraries into my project: pandas, datetime, tkinter, win32

    • @SukruthJayam
      @SukruthJayam 2 года назад

      same here, Did u find any solution for that?

  • @MrTonka777
    @MrTonka777 4 года назад

    Windows and Mac OS X specific options
    -c, --console, --nowindowed
    Open a console window for standard i/o (default). On Windows this option will have no effect if the first script is a ‘.pyw’ file.
    -w, --windowed, --noconsole
    Windows and Mac OS X: do not provide a console window for standard i/o. On Mac OS X this also triggers building an OS X .app bundle. On Windows this option will be set if the first script is a ‘.pyw’ file. This option is ignored in *NIX systems.

  • @KasturiBurman
    @KasturiBurman Год назад

    I have created a python exe using this process, but when I distribute it to others and try to run the exe on another pc the application does not run. It just pops up for a second and closes automatically. Is there a way to solve it?

  • @parthrangarajan7474
    @parthrangarajan7474 2 года назад

    I am having some trouble making this work on a Mac. Could you help me out?

  • @ggssspalwal8676
    @ggssspalwal8676 2 года назад

    very fruitful

  • @AbhishekYadavInd
    @AbhishekYadavInd 5 лет назад

    Great Video for Python...useful

  • @FPChris
    @FPChris 3 года назад

    You can't do a OSX build from the Windows install?

  • @Allan_Ralph
    @Allan_Ralph 3 года назад

    One Doubt ! I have some empty folders which are needed as temporary storage for image processing , how to add it to Pyinstaller ?

  • @hareknowsnone
    @hareknowsnone 4 года назад

    My exe is not working on windows 10. What to do? I did everything on windows 7.

  • @deepika3389
    @deepika3389 4 года назад

    While installing pyinstaller it is giving this error.
    Failed to build pyinstaller
    ERROR: Could not build wheels for pyinstaller which use PEP 517 and cannot be installed directly.
    How to resolve it?

  • @esms5135
    @esms5135 4 года назад

    It won't work if the other computer doesnt have python, because 'Handshaking' does not happen with operating system and interpreter language ,here python . Therefore to make it run on pc without python the code should be compiled , so either the python code should be compiled somehow or the code should be written in compiler language like C

  • @Surya9201
    @Surya9201 2 года назад

    Hi, I built a GUI using QT designer and using python for the backend script and calling this UI file. how we can build an executable file when i have one python and one UI file?

  • @xXghostninja
    @xXghostninja 5 лет назад +1

    keep getting PyNaCl library needed in order to use voice. It works on my pycharm but not executabel

  • @rohitkr.9307
    @rohitkr.9307 4 года назад +1

    Sir , i have a simple kivy file i want to execute other py file via kivy and get the output on mobile in kivy gui how can i do
    Actually i want to make an app like qpython, pydroid to run python file via kivy interface
    I searched the whole internet butvi did not get the way to do this
    Please respond me and make a video on it please i will be very thankful to you please.....

    • @DaviSilveira
      @DaviSilveira 4 года назад

      I'm not sure I understand your question completely but if you want to create an app on your phone with Kivy you need to use their Buildozer tool and be on a Linux machine.

  • @dasmaffin1633
    @dasmaffin1633 5 лет назад +1

    Dist is empty for me
    How do I fix this?

  • @KarthikKarthik-lg3ye
    @KarthikKarthik-lg3ye 3 года назад

    In my computer there is problem in pyinstaller like UPX in not available

  • @woofelator
    @woofelator 4 года назад

    Just the video i needed!

  • @alvarocrespo3748
    @alvarocrespo3748 5 лет назад

    Fantastic tool! I love the "Current Command" window! Thanks

  • @Megaheropap
    @Megaheropap 3 года назад +1

    Possible on Mac?

  • @swapnilpatil2445
    @swapnilpatil2445 3 года назад

    Hello, need video on How to reduce exe file size. Thanks for the video.

  • @adityak3578
    @adityak3578 4 года назад

    Is installable .exe can be copied to another windows...can i sell my python file likewise without the fear of piracy?

  • @madhavvenu3529
    @madhavvenu3529 3 года назад

    can we run the executable file thus created on any windows even without Python ?

  • @ishpreetkaur3332
    @ishpreetkaur3332 3 года назад

    I am unable to create ubuntu executable. Please tell what command I need to type for ubuntu?

  • @zakirdhoomun8625
    @zakirdhoomun8625 3 года назад

    Hi. Can't install " pip install pyinstaller". Am having the following message:" Defaulting to user installation because normal site packages is not writeable". Can somebody explain please.

  • @stepsvideos
    @stepsvideos 3 года назад

    Excellent. Thank you.

  • @sebastianraszczuk4282
    @sebastianraszczuk4282 3 года назад

    I did this nsis file (just like you, step by step), and then when I try to sent this by e-mail to my friend or when I try to open this on another computer- I have antivirus or smart screen error that "IT IS A VIRUS AND YOU CAN NOT OPEN IT!". What can I do with it? This nsis file or exe works only on my computer and no one elses...

  • @modusvivendi9038
    @modusvivendi9038 3 года назад

    Is it possible to make the exe file to accept few arguments also , if so how, can you share some web links to understand the process?

  • @sainagabharat79
    @sainagabharat79 4 года назад

    Excellent video...
    How to add copyrights information?

  • @autarroy
    @autarroy 3 года назад

    hi sir, is it possible to use NSIS directly to convert your application(tkinter)

  • @akhilap9652
    @akhilap9652 4 года назад

    I amnot from a computer science background... Can u please how can we make this exe file open in our mobilephone

  • @FPChris
    @FPChris 3 года назад

    Dist built on Catalina crashes. Runs fine from terminal.

  • @vigneshnagaraj7137
    @vigneshnagaraj7137 4 года назад +1

    Time taken is longer when I click the exe. Is it possible to reduce the starting time of executable file

    • @jonathannorris8255
      @jonathannorris8255 4 года назад +1

      when bundline to single exe (onefile) pyinstaller must create copies of all needed files into temp folder which is why it takes longer.

  • @fernandohood5542
    @fernandohood5542 4 года назад

    How come your antivirus does not try to delete the file?

  • @grendbelema
    @grendbelema 4 года назад

    thanks for sharing, worked for me

  • @manakwadhwa
    @manakwadhwa 4 года назад

    My project is having a main.py file and it has 17 dependencies how should i make them into a one file as it is having links inside it to other files ??? I do have a database i.e. a .db file

  • @titholinux4532
    @titholinux4532 3 года назад

    how about script requirements and dependencies

  • @alibekka4231
    @alibekka4231 2 года назад

    do i have to use the admin version of the command prompt? it is not working on the non admin version

  • @Foll3tt3
    @Foll3tt3 2 года назад

    Thank you very much, Sir.

  • @adityaraj4674
    @adityaraj4674 4 года назад

    I'm getting Errno 2... for every file that i need to load.... please help.. ASAP!!

  • @a.svasial884
    @a.svasial884 4 года назад

    fatal error detected failed to execute script pyi_rth_pkgres.... Showing this error when i open my tkinter project.... Plz help me bro

  • @ikekuian8173
    @ikekuian8173 5 лет назад +1

    cmd writes that "'pyinstaller' is not recognized as an internal or external command,
    operable program or batch file" :-(
    What can I do?

    • @rajeshwaris6663
      @rajeshwaris6663 5 лет назад

      Set env path

    • @youtubeuser.0
      @youtubeuser.0 3 года назад

      go to CMD and type in ‘pip install pyinstaller’ and it should install

  • @tiagopaivaguimaraes4465
    @tiagopaivaguimaraes4465 4 года назад

    You are the man, i love you

  • @FPChris
    @FPChris 3 года назад

    8:00 What is the filesize? Can the user run it without having to download python or anything else?

  • @hassanarabi1987
    @hassanarabi1987 3 года назад

    What when we scan exe file building by pyintaller we find a lot of malware and trojan

  • @marionetx1458
    @marionetx1458 5 лет назад +1

    I tried with all of my codes and a simple code [ print("Hello") ], but the window always closes in a split second.

    • @gweebg
      @gweebg 5 лет назад +1

      Add this to your code at the end: exit = input("Press Any Key To Leave.")

    • @marionetx1458
      @marionetx1458 5 лет назад

      ​@@gweebg Thank you. It works with simple code with Python, but it does not work with my code with Kivy. Is this normal?

  • @justice2493
    @justice2493 2 года назад

    thank you for nice tutorial. I have a question. after I run my .exe file and input some data into database, when I exit the program the data I saved is no longer.

    • @Tovin
      @Tovin 2 года назад

      Make sure you are saving the data into an external database and a python file does not store any information locally after being closed. You can use the --add-data or --add-binary build attribute for this:
      pyinstaller.org/en/stable/spec-files.html#adding-files-to-the-bundle

  • @aneeshmalapaka8363
    @aneeshmalapaka8363 4 года назад

    hello, i my app got built but i am getting error, fatal error detetcted and failed to open script (my_prog_name)
    any solution to such pls..

  • @ivancamilodamian2137
    @ivancamilodamian2137 4 года назад

    works on a client pc without python installed previouslly?

  • @thealphabetagamma5252
    @thealphabetagamma5252 2 года назад

    79 INFO: UPX is not available. I get this error after executing the pyinstaller command . Can you please help me with this ?

  • @programming_hut
    @programming_hut 4 года назад +1

    how to make linux executable file

  • @mukulM2010
    @mukulM2010 4 года назад

    Hey I'm getting the "File not found" 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?

  • @guillermoh.k.2967
    @guillermoh.k.2967 4 года назад

    Thanks for uploading!

  • @jxtian8950
    @jxtian8950 3 года назад

    5:42 When I double click on this file, my console just quickly opens and then closes.

  • @maxwellgerhardson1647
    @maxwellgerhardson1647 3 года назад

    I am only seeing a MY_PROGRAM.exe.manifest file?

  • @AjaySharma-vz9ei
    @AjaySharma-vz9ei 5 лет назад

    It's not working for Jarvis code ...... Why ? ........ Any help ? thanks

  • @filosman4291
    @filosman4291 4 года назад +1

    thanks

  • @AnilKumar-dc6hv
    @AnilKumar-dc6hv 3 года назад

    great explanation

  • @lifechanger957
    @lifechanger957 4 года назад

    Sir my python file need to first type conda activate pro to start it so how can i use it please help

  • @RoMannweiler
    @RoMannweiler 3 года назад

    It does not work. I tried with a simple hello world program. Even though I installed everything as described, starting pyinstaller did not work. Instead I got the error message, that the 'pyinstaller' command was not found. Is there any solution for that?
    Thanks in advance!

  • @Leo-if9xz
    @Leo-if9xz 3 года назад

    do you know how to make an exe file, who reads pictures file?