I had been looking for tutorial of adding other modules and files with py installer. Thanks you nicely explained and satistied need. Looking forward for your future videos.
@rahelly844 жыл бұрын
hi, i am still struggling, can you help? i have a folder contains Python scripts and main does not find it
@Xaminn4 жыл бұрын
This was an excellent tutorial! I now know how to package my projects for simple deployment. 5/5 Cheers!
@MateusDvk2 жыл бұрын
Thanks for the tutorial Sourav!! greetings from Brazil!
@harshith_takkala3 күн бұрын
how can i make sure only the packages from virtual environment are packaged under exe, not all the python global packages
@kenmsmith4 жыл бұрын
How do we create an exe in Python 3.8 or using Pycharm? Apparently this older pyinstaller method doesn't work with the latest Python
@aishwaryamurugappan51383 жыл бұрын
That was keeping it simple and clear at the same time😍🤝🔥
@NoCodeFilmmaker5 ай бұрын
Does this work if the app was built with and depends on a virtual environment?
@iamhritikpawar5 жыл бұрын
Thanks, dude it was awesome the videos of others didn't work but this worked for me.
@doggydoggywho3 жыл бұрын
Can you help me in solving the following problem: My python executable needs to read an xml file and then based upon it performs some operations and creates the output xml file. While I have an standalone executable file, however it only works inside the folder where my pycharm project is located. Also it reads the xml file only in that folder. I have tried putting the xml file and the exe in a new folder together, however it does not work. Also if there is some way to embed the xml file into the python script, that'd be great.
@krishj80114 жыл бұрын
I recently joined your AI/ML course and its awesome...
@SouravJohar4 жыл бұрын
Which course? 😅
@israeletu3 жыл бұрын
Please is it possible to change the icon to any picture or figure of choice?
@VINAYVS19913 жыл бұрын
Good job Sourav and thank you for this!
@Kruzzles4 жыл бұрын
where is the exe file saved??
@harrisonwebb65104 жыл бұрын
I get this error when trying to run it -bash: Pyinstaller: command not found
@autarroy3 жыл бұрын
Hi Sourav, i I have images jpg into my application, also an icon How i must write the code
@ziiby4177 Жыл бұрын
The only tutorial that works.
@petermenzel943 жыл бұрын
How do you avoid the program being flagged as a virus? Even my very simple scripts can't be emailed or opened on company computers. I can't find any resources online.
@thecardtrickstudent38702 жыл бұрын
sir, when i call the executable is doesn't run until the virtual environment is activated. How to fix it?
@danishhamdule41122 жыл бұрын
Thanks man. I have one question if i have Tkinter application with two separate python file one runs the machine learning iniferecing and other runs the UI and Data Query...i there any way to merge both into one
@aparnapathivada61204 жыл бұрын
@Sourav Johar I have tried your code in windows but my files are not moving and I am copying those files in dist folder manually. Could you please help me on this.
@AmanSingh-dv8br2 жыл бұрын
Bro kya database project me use kiya ho to use exc file me change karne ke liye koi difference code nhi likhna hota na
@sonepratap4 жыл бұрын
Great work Sourav..
@sameerk129824 жыл бұрын
Thanks a lot Sourav....this is very helpful tutorial......working for me....exactly what I was looking for....appreciated.....Subscribed....looking forward for more....please make more videos on python...you explain very well.
@aditiagarwal86464 жыл бұрын
The video is very clear, simple and crisp. Thank You!
@bennguyen13134 жыл бұрын
How can you force pyinstaller to build using python 2.7? It seems by default doing a 'pip install pyinstaller' will install pyinstaller 3.6 which *SHOULD* support python 2.7 and 3.4? Yet when I try to build CanFestival3/objdictgen/objdictedit.py (wx gui) it complains about no parenthesis around prints! Interestingly, doing an import PyInstaller , PyInstaller.__version__ it says 3.5?! Update: for some reason pip was being installed in python27-x64\Scripts , so using that pip to install pyInstaller it now shows 3.6! Unfortunately, 'pyinstaller objdictedit.py' still results in an exe that doesn't run (errors like 'no module named core')
@enriquenieto91356 жыл бұрын
You are awesome Aourav!!!
@shreyasjoshi93 жыл бұрын
pyinstaller: error: argument --add-data: invalid add_data_or_binary value: "'C:\\projectX\\MartinAuto\\util\\exp.py:.'" I get this error when i follow the --add-data command. It would be great if you could help me. I am kinda stuck
@Pradeep_prasad3 жыл бұрын
This code create new dB but I want add my existing table ,pls help pls
@Tommy_0072 жыл бұрын
Why was there no reference to the other .py file in the command?
@austinyasuda4284 жыл бұрын
I can't use docopt in my driver after using pyinstaller. Can someone help?
@adarshs29484 жыл бұрын
so on which all os can I deploy the .exe file created on Linux?? Help!!!!
@aoihana10423 жыл бұрын
Thank you for your clear and concise explanation!
@xcreame19914 жыл бұрын
Hi bro, i have done this but how to render ipywidgets into the executable as well?
@matiastika13294 жыл бұрын
I tried this and I couldn't make it work on other computers.. After I builted the '.exe' I passed everything in my project folder because I figured if it works in my PC, it should work, but in the other computer, I could run the application and execute all front-end code (html+css+js works correctly) yet the Python code is not running. Anyone else had this problem? Help!
@mjones4102 жыл бұрын
thank you, still relevant and helpful in 2022 :)
@deeprony74 жыл бұрын
Is there a way to generate a .exe from Linux/Mac with pyinstaller?
@liamfitzpatrick43524 жыл бұрын
Thanks for the quick tutorial! If I want to package more than one data file, how can this be done?
@jamesjoseph1524 жыл бұрын
I have this same problem too
@charlesjsescoto4 жыл бұрын
did u find solution on that?
@gboyegaokiki87362 жыл бұрын
Sorry, have you gotten a solution to this problem?
@saitech24524 жыл бұрын
does this work with python script that has selenium will it take care of the path?
@alessandroceccarelli23205 жыл бұрын
How do you load the data in the main script? how do you specify name and path of the file?
@brubrudsi4 жыл бұрын
Extremely good tutorial
@MoneySmartWays5 жыл бұрын
is there a way i can run a python script everytime my system starts? Suppose i create an executable, the user clicks on the executable install it and this will trigger my script everytime my system boots up.
@prateekpanwar6465 жыл бұрын
Just copy executable file into Windows startup folder. Not sure for windows 10
@pujanrai1594 жыл бұрын
i have made a python script on mac if i give executable file to windows friend does this work?
@SouravJohar4 жыл бұрын
No. You would have to compile the executable on a windows machine to make a .exe file.
@jaiv6 жыл бұрын
Is it possible to use --add-data to add entire directories?
@polymix29715 жыл бұрын
How much difference there is in terms of performance after compiling ?
@sanketgupta41395 жыл бұрын
I have a question. You are using spent.db which already contains data. When you package it inside. it should reflect the data. Also, the code you wrote in init() will only work once. Since you are using the create table if not exists but already the db exist. So if I want to clear the table and start from beginning it is not possible to do that. Am I correct?
@jamjam13324 жыл бұрын
I have a GUI implemented in the program which uses a .gif file. When I run the program an error is raised saying the .gif file cannot be found. I put the .gif file in the dist folder and it started working again. Is there any way to get the program to work without having the .gif file in the same directory? thanks :)
@noahclark66204 жыл бұрын
Jamie Braham maybe get the source data of the gif file and store it in your code with Pillow image library, then parse and display it using the same library. You wouldn’t need an external file, it would be stored in your code
@mrshubh1014 жыл бұрын
I'm trying to package my Python script into an executable, but the final executable generated is way too large in size. My script just makes use of pandas. Is there anyway I can try to make the executable compact? I just want it to be small enough, so that it runs with the minimum number of packages imported in it.
@pritnadoda42983 ай бұрын
Did you solve the issue? I'm also facing it as the .exe includes so many dlls and dependencies of easyOCR incl. It's Torch dependency. After using easyOCR my .exe went from 200MB to 2.7 GB. that doesn't seem cool
@fashadahmedsiddique84123 жыл бұрын
What should be the command If there is more than one sub-module of the main script file?
@gboyegaokiki87362 жыл бұрын
Sorry, have you gotten a solution to this yet?
@fashadahmedsiddique84122 жыл бұрын
@@gboyegaokiki8736 Yes bro it's been a year
@gboyegaokiki87362 жыл бұрын
@@fashadahmedsiddique8412 lol.... I just got to where I needed this..... how did you solve the problem.... I have 3 files which are linked together so I want to convert them to a single execution file
@zerohour27514 жыл бұрын
Hi Sourav can we use the command add-data for xlsx files, and if want to add to files what do we need to type. Thanks in advance
@anujkumarnath17696 жыл бұрын
I tried this with my pyqt project and while running the generated executable file it says PyQt5 not found. It seems that library wasn't added during building the package.
@SouravJohar6 жыл бұрын
You can manually add it in the .spec file created by PyInstaller.
@deepakmoonat87045 жыл бұрын
@@SouravJohar where to add,in hiddenimports list?
@FRIENDSofCAP5 жыл бұрын
Hello, Nice tutorial... A couple of question however. (1). I am writing my code either on a Mac Pro desktop with Mac OSX Catalina or on one of several Raspberry Pi 3B+ and 4 Model B boards. I just used your tut to generate an executable and it workd from my Pi board since that is where I ran the pyinstaller --onefile programname.py from... If I do the same for apps developed on my Mac I assume it will generate an .app executable as used on Mac? (2). If I want do develop on my Mac as usual (except for when doing stuff or Pi boards) can I some how, on my Mac generate an EXE which I can then distribute to folks running WIndows? And will the EXE's run on both 32 and 64-bit WIndows / Mac Machines? Look forward to your reply.. Thanks, Tim...
@SouravJohar5 жыл бұрын
For your first guestion, no, phinstaller doesn't produce a .app on MacOs. It produces a binary file (like on Raspberry pi). You can checkout py2app for this. Second one is also a no. You can put generate exe on Mac using pyinstaller. You need to run pyinstaller from a Windows machine for that.
@andrewwang57654 жыл бұрын
When I use pyinstaller to package pyqt program,My computer is OK,but if i use this exe to the other computer,it will say : Faile to excute scipt main.
@aayuxh474 жыл бұрын
if you use images or audio you need to add data
@rohitbharti88364 жыл бұрын
bro i have photos for my main file how to import all those photos too
@deepakmoonat87045 жыл бұрын
I am getting error 'pyinstaller' is not recognized as an internal or external command, operable program or batch file. i have also tried running it using python pyinstaller --onefile --add-data 'data:.' final_code.py but it also throws an error python: can't open file 'pyinstaller': [Errno 2] No such file or directory
@SouravJohar5 жыл бұрын
Run 'pip install pyinstaller'
@deepakmoonat87045 жыл бұрын
@@SouravJohar I got the error..I have not set the path for it Thanks
@Extorc4 жыл бұрын
ill be honest with you , u should create more often
@elitefdc21714 жыл бұрын
Failed to execut script
@Erbmon4 жыл бұрын
Thanks mate, I wanted to share a quick tool I made and this made it a brease
@israeletu3 жыл бұрын
Thanks for the video.
@VGV03 жыл бұрын
Very precise thank you.
@Pranshu1902p4 жыл бұрын
What was in the spent.db?? You didn't share that
@SouravJohar4 жыл бұрын
That was not relevant to the video. Think of that as just a dependent file which your code needs.
@notproplayer36494 жыл бұрын
@@SouravJohar but how do I get this file then ?
@j.b.dineshkumar11-bio754 жыл бұрын
Bro I need some help from you bro
@mohammedmuqtadirmujtaba95146 жыл бұрын
Awesome video !!!.. Thanks alot :)
@arjunpukale33105 жыл бұрын
But u didn't include the other python file
@SouravJohar5 жыл бұрын
It automatically gets picked up, as we have imported it as a module in our main python file.
@arjunpukale33105 жыл бұрын
@@SouravJohar my python file has a dependency on a saved ml model. When i run the script using cmd it works perfectly but when i create exe file it says fatal error: cannot run the script
@SouravJohar5 жыл бұрын
You need to add this ml model as a data dependency while making the executable
@arjunpukale33105 жыл бұрын
@@SouravJohar actually i found the error, i made a simple file and added just one line : import sklearn. Now sklearn is installed in my anaconda virtual environment . But after creating exe it gives error no module named sklearn. So how to use pyinstaller for a python file in an virtual environment
@RahatulIslamUdoy4 жыл бұрын
Windows detects the exe file as virus. How to solve it?
@dairyprods4 жыл бұрын
if its an unsigned file it'll pretty much always be stopped by your AV. signing is mainly for companies so if you want to pay Microsoft $500 dollars for a digital signature go for it
@alifrazkhan124 Жыл бұрын
very good indeed
@timtim9o55 жыл бұрын
can you do a tutorial freezing django with this ?
@AlanRiosoff5 жыл бұрын
how to add binary? folder > nodejs.exe hey.py
@colourfultoreador84673 жыл бұрын
Nice video
@ashishthapa5296 жыл бұрын
awesome :)
@kingslyroche6 жыл бұрын
Great.👍
@pythonfan86885 жыл бұрын
The only downside is that it only works on the platform you converted it on, be it Windows 7, 10 or something else.
@joshuaolukotun94993 жыл бұрын
If you convert it to exe on 32 bit, It would work on all Windows 32 bit... irrespective of the Windows version
@anaghanimbekar79105 жыл бұрын
hello, Iam trying make an executable for my python script but after running the command "pyinstaller --onefile 5feb_accuracy90.py" , it gives error like 48 INFO: PyInstaller: 3.4 48 INFO: Python: 3.6.8 49 INFO: Platform: Linux-4.4.0-142-generic-x86_64-with-debian-stretch-sid 49 INFO: wrote /home/intern/5feb_accuracy90.spec 51 INFO: UPX is not available. Traceback (most recent call last): File "/home/intern/anaconda3/bin/pyinstaller", line 10, in sys.exit(run()) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run run_build(pyi_config, spec_file, **vars(args)) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build exec(text, spec_namespace) File "", line 17, in File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 189, in __init__ raise ValueError("script '%s' not found" % script) ValueError: script '/home/intern/5feb_accuracy90.py' not found can you please help me out? Thank you
@SouravJohar5 жыл бұрын
Looks like pyinstaller is unable to find your python file. Make sure you're running the command from the right directory, which has your python file.
@anaghanimbekar79105 жыл бұрын
@@SouravJohar yes i am running the command from the same directory of my python file .But still facing the issue.
@anaghanimbekar79105 жыл бұрын
now i am getting the following after running the command "pyinstaller --onefile --add-data '/home/intern/anaconda3/anagha:.' 5feb_accuracy90.py" 48 INFO: PyInstaller: 3.4 48 INFO: Python: 3.6.8 49 INFO: Platform: Linux-4.4.0-142-generic-x86_64-with-debian-stretch-sid 49 INFO: wrote /home/intern/anaconda3/5feb_accuracy90.spec 51 INFO: UPX is not available. 52 INFO: Extending PYTHONPATH with paths ['/home/intern/anaconda3', '/home/intern/anaconda3'] 52 INFO: checking Analysis 131 INFO: Appending 'datas' from .spec 154 INFO: checking PYZ 154 INFO: Building PYZ because PYZ-00.toc is non existent 154 INFO: Building PYZ (ZlibArchive) /home/intern/anaconda3/build/5feb_accuracy90/PYZ-00.pyz 6699 INFO: Building PYZ (ZlibArchive) /home/intern/anaconda3/build/5feb_accuracy90/PYZ-00.pyz completed successfully. 6761 INFO: checking PKG 6761 INFO: Building PKG because PKG-00.toc is non existent 6762 INFO: Building PKG (CArchive) PKG-00.pkg Traceback (most recent call last): File "/home/intern/anaconda3/bin/pyinstaller", line 10, in sys.exit(run()) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run run_build(pyi_config, spec_file, **vars(args)) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build exec(text, spec_namespace) File "", line 32, in File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 424, in __init__ strip_binaries=self.strip, upx_binaries=self.upx, File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 196, in __init__ self.__postinit__() File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__ self.assemble() File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 273, in assemble pylib_name = os.path.basename(bindepend.get_python_library_path()) File "/home/intern/anaconda3/lib/python3.6/posixpath.py", line 146, in basename p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType waiting for your reply .
@anaghanimbekar79105 жыл бұрын
now i am getting the following after running the command "pyinstaller --onefile --add-data '/home/intern/anaconda3/anagha:.' 5feb_accuracy90.py" 48 INFO: PyInstaller: 3.4 48 INFO: Python: 3.6.8 49 INFO: Platform: Linux-4.4.0-142-generic-x86_64-with-debian-stretch-sid 49 INFO: wrote /home/intern/anaconda3/5feb_accuracy90.spec 51 INFO: UPX is not available. 52 INFO: Extending PYTHONPATH with paths ['/home/intern/anaconda3', '/home/intern/anaconda3'] 52 INFO: checking Analysis 131 INFO: Appending 'datas' from .spec 154 INFO: checking PYZ 154 INFO: Building PYZ because PYZ-00.toc is non existent 154 INFO: Building PYZ (ZlibArchive) /home/intern/anaconda3/build/5feb_accuracy90/PYZ-00.pyz 6699 INFO: Building PYZ (ZlibArchive) /home/intern/anaconda3/build/5feb_accuracy90/PYZ-00.pyz completed successfully. 6761 INFO: checking PKG 6761 INFO: Building PKG because PKG-00.toc is non existent 6762 INFO: Building PKG (CArchive) PKG-00.pkg Traceback (most recent call last): File "/home/intern/anaconda3/bin/pyinstaller", line 10, in sys.exit(run()) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run run_build(pyi_config, spec_file, **vars(args)) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build___main.py__", line 838, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build___main.py__", line 784, in build exec(text, spec_namespace) File "", line 32, in File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/__api.py__", line 424, in _init_ strip_binaries=self.strip, upx_binaries=self.upx, File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 196, in _init_ self.__postinit__() File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/__datastruct.py__", line 158, in _postinit_ self.assemble() File "/home/intern/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 273, in assemble pylib_name = os.path.basename(bindepend.get_python_library_path()) File "/home/intern/anaconda3/lib/python3.6/posixpath.py", line 146, in basename p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType waiting for your reply .
@Luis_06195 жыл бұрын
Awesome! :) how can you add a image and or folder?..... please help :)
@Zhisaoka4 жыл бұрын
Thanks so much
@julianf.664 жыл бұрын
Can you share the source code of your example? :)
@shreyamaheshwari2426 жыл бұрын
👍👍
@nemishjain36753 жыл бұрын
Heyyy! I'm getting some problem while converting my python project to exe. Can i get your mail id??
@hmak54234 жыл бұрын
Didn’t get to the point even till the end.
@G_a_n_d_u17 күн бұрын
Jai shree Ram
@jackzero52303 жыл бұрын
whe i run exe file its giving file not found error, if I exclude --onefile flag it works fine...why? instead of .db file my code runs on an excel file, does that make a difference?
@gblightb5 жыл бұрын
I have a simple html opened through a python script using os.startfile('index.html') I ran pyinstaller to build the exe file but why am I getting *Failed to execute script* error message???
@tarsus2354 жыл бұрын
crashes when I try to do this with Pandas. pd.read_csv('my_csv.csv') causes a FileNotFoundError. Don't know why.