Lovely post. I just learnt this new method of binding python and electron. I have been thinking of how to use python and electron for my new desktop application and you just came through with this perfect demonstration. Thanks alot
Hi. Thanks for the beautiful video on this one of a kind implementation. It would be helpful if you could show us on how to package the whole app and distribute it. As we use electron for cross-platform development. Thanks in advance for the packaging tutorial.
Its just a toy code. won't be useful for production. You need to improve integration and then package software into installer package. if your code is not opensource, then you need to find a way to prevent other to view your code.
I referred a lot of videos and articles regarding electron to solve my problem. But, this was the best! Crisp and clear. Thank you soo much. Continue the good work 👌👌
This is super helpful. How do I create a Windows installer that also includes the python code? I can only find tutorials that only include the gui folder.
Where is the LOVE button. This may be a little older, but this is AMAZINGLY PERFECT! Anyone starting should see this as one of their FIRST videos! THANK YOU!!!! THANK YOU! Thank You from the bottom of my heart!
if you are referring the following video and using electron version 10 or above then you must add the following code in electron main.js: - const mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true } }) otherwise electron will not be able to call your python file when you click a button on your HTML file.
Great tutorial. Just left we with one question, what happens when you compile, does the engine folder compile together or the user has to manually place the folder along the builded .exe?
Hello Sourav! Great job, Explained everything very clearly. Now, would you like to guide on how to pack this app as standalone installer. Thanks in advance bro
For the object detection, you could use TCP for message passing, running both a python process and the electron app, and allowing IPC using something like ZeroMQ, ZeroRPC, ... This would decrease the overhead of running the flask server by a bit.
What about compile the app? There 15:30 you are seting a static path for python on your computer, if run this app in another comuter it wont run correctly. The same for compiling, i need to install python in the same exactly path you put in tha config object. Solution? Need i bundle python with electron?
Hi Sourav, not sure if you are keeping up with the comments on this video or not, but I believe this approach doesn't work anymore because electron by default disabled node integration except from the main processes. So, if I do the weather example, I get a reference error that "require()" is not defined because weather.js is not a main process. Still figuring out a way around this change...
It is so confusing, there are so many JS based thing going on...AJAX, NodeJS, React and this and that ... ElectronJS. What to learn? Btw amazing video!
If i want to distribute a builded standalone app in this way i'm going to use electron-package for the frontend...but how to put the python interpreter in a way that the vuilded app doesn't require python to be installed on the computer?
While Using and clicking on submit in weather forecaster it redirects me to a blank page in both browser and electronjs app. In the browser it is seen in the bar "file:///path/to/electronjsapp/.../?" And shows that the file was not found and also seen that browser doesnt understand require () tag
When executing object_detection.py the following error occurs: Could not find the DLL (s) 'msvcp140.dll or msvcp140_1.dll'. What version of Python TensorFlow to run the project?
hi, if i want to build an executable for this app, is it straightforward with an electron-packager? i was previously working on python app and created an exe with pyinstaller... just wondering if on an electron-python app, does an electron packager manages the packaging on the python part as well...?
Can I integrate this with database and excel ..I have a requirement & inspired by this I want to follow you but my end users use this app ..but one path should go to excel & other should write into database
When packing an app with electron. Does it require the client to have python already installed to work with it? I mean in eel, the user didn't need to install python right ???
I found a link that could be very helpful how to deploy a an electron app alongside with python. here is the link medium.com/@abulka/electron-python-4e8c807bfa5e
Hey i did everything same as you, installed python-shell using command "npm install python-shell" but when executing, i get python is not a constructor. Any help will be highly appretiated.
Hi, please help me. I have a dependency model.pkl (pickle file) and my python script name is FinalModel.py which needs model.pkl. please tell me the command line code. Im getting errors.
A great tutorial. I tried publishing app on the desktop with an icon. Once I click the icon app opens but only front-end works. the back-end python script not working.
This is so cool, but i have a question, How can i protect source code? for example, if i want other people use my app but i don't want anyone can copy my code, what will be the best way to protect this?
Hello, i got this message in dev console -- Failed to load resource: net::ERR_FILE_NOT_FOUND in weather.py:1. This is the line where i import requests. How can i install requests or any other python library in electron?
Hey I need some guidance on my next project. I am planning to make a desktop app using electron to manage finances, manage inventory & track orders so I need this desktop app to have a local database but I don't want other people to install any kind of external database software it should be like packaged within the app itself , and also this desktop app should be connected with some kind of online database (more on this later). And I also have made an android app to manage the end customer and provide them with regular updates and also collect data from them. Till now I have been using Google sheets and a web app to manage everything but this has recently become really problematic (many many issues) So I need to deploy my own database (local server or online server basically anywhere possible) and this has to be connected with my the electron app and the android app . . So basically 3 things => a desktop app with a embedded database & also linked to a online database => A android app which is connected to the online database => and the database itself Which manages all the data from the android app user and the desktop app user . . I have created the android app & also making the electron app seems doable BUT the embedded database & server database part seems really confusing and I have no clue what to do or where to start (the reason I picked electron for the desktop app is because I am really familiar with Javascript, HTML & CSS) . So I need some guidance (maybe alot) to make this happen
Also looking for a fix for the require not defined. I know this is an issue with Electon V5, specifically with NodeIntegration being false, but even when I turn it to true (and ContextIsolation to true just in case), I get no results. Very little info out there on the web too since v5 is relatively new and this is seemingly a big change. Any help would be greatly appreciated!
Whether it's linux, mac or pc, after building the app to an .exe, does the end-user have to install electron or python for this to work? Or is the .exe file itself an install file rather than a portable .exe, that will install any (server-side) software needed to run?
Did you try to use .send() and .receive() from python-shell? Not that Flask is a bad solution, but it seems like you could have used python-shell for Object Detection, as well. I'm curious to know if you tried that but ran into problems.
I did try that, but like I said in the video, whenever I start the object detection code, it takes a long time to initialize and load the model. That's why I used flask, that way the model is always in memory
It's all there. I recently removed the face recognition part due to some technical reasons. If you want those files, you can get them from an earlier commit
As far as I am concerned this is the only video of its kind . Helped me alot. Thank you sooo much .
Lovely post. I just learnt this new method of binding python and electron. I have been thinking of how to use python and electron for my new desktop application and you just came through with this perfect demonstration. Thanks alot
Hi.
Thanks for the beautiful video on this one of a kind implementation. It would be helpful if you could show us on how to package the whole app and distribute it.
As we use electron for cross-platform development. Thanks in advance for the packaging tutorial.
Bro. I need to hang out more with smart people like you. Thank's a lot!
@@justafighter1346 r/iamverysmart content
Finally I got the thing which I looking for centuries. Thanks!!!!!
lol
Its just a toy code. won't be useful for production. You need to improve integration and then package software into installer package. if your code is not opensource, then you need to find a way to prevent other to view your code.
An excellent tutorial. Possibly the only one online currently on using Python with Electron.
Yeah bc that's not how computer science works
If you see something on youtube, be sure it's not inefficient crap like this "combination" lmfao
In a nutshell: use Python-Shell inside electron
I referred a lot of videos and articles regarding electron to solve my problem. But, this was the best! Crisp and clear. Thank you soo much. Continue the good work 👌👌
I was finding a video like this for last 6 months!!
thanks for your idea and a lot more please don't let anyone comment discourage your efforts keep on helping other with your skills and knowledge.
Wow reaching this masterpiece after long time
This is super helpful. How do I create a Windows installer that also includes the python code? I can only find tutorials that only include the gui folder.
Did you find solution to this?
Thanks for the explanation. Like the simplicity of the presentation.
My my I can say surely that You will grow my bro!
Where is the LOVE button. This may be a little older, but this is AMAZINGLY PERFECT!
Anyone starting should see this as one of their FIRST videos!
THANK YOU!!!!
THANK YOU!
Thank You from the bottom of my heart!
if you are referring the following video and using electron version 10 or above then you must add the following code in electron main.js: -
const mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})
otherwise electron will not be able to call your python file when you click a button on your HTML file.
Excellent video bro. Please post more.
lol this is pure genius ,, keep it up man we want more stuff like this.
thank you for this. Great explanation of everything as well.
Thanks a lot Sourav! Your video helped me a lot in turning my project beautiful in an easy way. Also, kudos to RUclips's algorithm 😁
How to package this python shell along with electron js in windows/linux ?
I think your question is most important. It seems a difficult task.
Such helpful video. Thank you!
Keep uploading such videos. You just earned a new subscriber.
This was real good Sourav!
Great tutorial. Just left we with one question, what happens when you compile, does the engine folder compile together or the user has to manually place the folder along the builded .exe?
Did you find the answer to this?
Amazing! Thanks for sharing with us.
Thank you, Sourav for your tutorial!
Hello Sourav! Great job, Explained everything very clearly. Now, would you like to guide on how to pack this app as standalone installer.
Thanks in advance bro
I also want this!!!! Please, answer!
Dude you are amazing! Thanks for this video
For the object detection, you could use TCP for message passing, running both a python process and the electron app, and allowing IPC using something like ZeroMQ, ZeroRPC, ... This would decrease the overhead of running the flask server by a bit.
Thanks, I'll try it out!
Awesome and unique tutorial ❤️❤️
Is there a way to package everything into a single .exe or .msi using electron-packager? Including the python applets, specifically.
here is an explanation how to pack electron+python app to a standalone executable file medium.com/@abulka/electron-python-4e8c807bfa5e
What about compile the app?
There 15:30 you are seting a static path for python on your computer, if run this app in another comuter it wont run correctly. The same for compiling, i need to install python in the same exactly path you put in tha config object. Solution?
Need i bundle python with electron?
Nice video Sourav!! .I would like to know what is the level of expertise I would need on NodeJs to do this.
Hi Sourav, not sure if you are keeping up with the comments on this video or not, but I believe this approach doesn't work anymore because electron by default disabled node integration except from the main processes. So, if I do the weather example, I get a reference error that "require()" is not defined because weather.js is not a main process.
Still figuring out a way around this change...
yeah I'm also getting "Failed to resolve module specifier "python-shell" and "path"" errors
@@grantcary I got through these errors luckily. What are you trying to do? I can try to help
Awesome work, mate. Please more Python tutorials!
This is exactly what I was looking for
Thankyou so much : awesome information man
Beware that electron apps consume lots of memory! Just something to consider
That's right
Awesome Man!
Was looking for something similar (y)
Amazing bro! Thanks
I am getting a Uncaught reference error in the face.js linker file. The var python= require() parts won't work. Is this an electron js version issue?
how would you package an app like this?
Cool tutorial man... Nice work
how to export excutable file?
Good work man thank you for the tutorial ! Keep it up !
It is so confusing, there are so many JS based thing going on...AJAX, NodeJS, React and this and that ... ElectronJS. What to learn? Btw amazing video!
Is Electron providing the widgets (i.e. the look and feel of your buttons)? I don't see any CSS there.
I use bootstrap. It helps people like me who don't know much web development 😂
Very helpful. Thank you
If i want to distribute a builded standalone app in this way i'm going to use electron-package for the frontend...but how to put the python interpreter in a way that the vuilded app doesn't require python to be installed on the computer?
Thanks for this great video. I just want to know about it's performance if it's kind of a inventory management app with lots of requests in realtime.
Hi there, I have same question. Have you find any answer in this regard ? Kindly do share with me, thanks.
Very nice video man!
Cool man. U covered all my clarifications
While Using and clicking on submit in weather forecaster it redirects me to a blank page in both browser and electronjs app. In the browser it is seen in the bar "file:///path/to/electronjsapp/.../?" And shows that the file was not found and also seen that browser doesnt understand require () tag
Awesome! Congrats!!! Nice video!!!
When executing object_detection.py the following error occurs: Could not find the DLL (s) 'msvcp140.dll or msvcp140_1.dll'. What version of Python TensorFlow to run the project?
The comments are awesome :). So I'll check your video out bro !
Hi is it possible to embed the camera/video to the GUI/Interface? instead of showing another window for the camera/video.
I had installed requests,but it cannot find the module ,
events.js:182 Uncaught PythonShellError: ModuleNotFoundError: No module named 'requests'
Nice. How do you deploy and package it into a working app? It worked until I deployed mine
hi, if i want to build an executable for this app, is it straightforward with an electron-packager? i was previously working on python app and created an exe with pyinstaller... just wondering if on an electron-python app, does an electron packager manages the packaging on the python part as well...?
Can I integrate this with database and excel ..I have a requirement & inspired by this I want to follow you but my end users use this app ..but one path should go to excel & other should write into database
how would you install dependencies for python on client machine
Compilation
first install npm installl pip then pip install (dependencies)
Qt is not ancient-looking. You can style it just like any web-based UI.
There's also QML.
qt is not free (for commercial use) though
Qt is unhappily platform dependent..
Hello, i installed all stuff, but when i enter any city in weather nothing happenning. What problem may be?
Local package.json exists, but node_modules missing, did you mean to install?
When packing an app with electron. Does it require the client to have python already installed to work with it? I mean in eel, the user didn't need to install python right ???
I had the same question too because this is the most important part, it's not really worth it if the user needs to install python to make it work
I found a link that could be very helpful how to deploy a an electron app alongside with python. here is the link medium.com/@abulka/electron-python-4e8c807bfa5e
@@BoukariYameogo I found eel to be very useful for me..try it out
Hey i did everything same as you, installed python-shell using command "npm install python-shell" but when executing, i get python is not a constructor. Any help will be highly appretiated.
check my comment, I had the same issue.
I understood nothing, but i liked it...
I was sick of PyQt. Thanks for introducing this.
what is the name of this colorsheme ? it looks amazing !
city lights
Hello... the python script I integrated referring to your video is not working... I cant seem to understand whats wrong with it
so i debugged step by step the JS and it starts with require not defined
HI Bhaiyya,
May I know, How you are making these videos? I am getting issues in audio sync.
Any help or suggest highly appreciated.
Hi, Sourav Thanks for this video. R u interested to help us with a python desktop app that we are building with small functionality?
Great Video! Thanks man. Also, Is it possible to achieve database CRUD functionalities with this approach ?
Hi, please help me. I have a dependency model.pkl (pickle file) and my python script name is FinalModel.py which needs model.pkl. please tell me the command line code. Im getting errors.
A great tutorial. I tried publishing app on the desktop with an icon. Once I click the icon app opens but only front-end works. the back-end python script not working.
I was able to successfully package this app as an executable. I plan to make a video about it in the coming days.
@@SouravJohar Hi Sourav, did you finally make the video?
This is so cool, but i have a question, How can i protect source code? for example, if i want other people use my app but i don't want anyone can copy my code, what will be the best way to protect this?
How can we package this in order to install it in Windows or Linux ? (Not separatedly, but as a unique project ?)
iam getting unable to reference python-shell even though it is installed and getting listed
Hello my brother is creating a trading bot he wants me to create a GUI front end. would this be a good way?
Hello, i got this message in dev console -- Failed to load resource: net::ERR_FILE_NOT_FOUND in weather.py:1. This is the line where i import requests. How can i install requests or any other python library in electron?
The Electron works as an alternative to Qt and GTK, right?
Thank you so much! Great video!
Ehy man, which do u used to create the html structure with button exc...?
Hi, Im making an app, but when I import bluetooth library to Python code, Im getting error "no bluetooth module found", can someone help? Thank you.
This is brilliant! Thanks a lot👍
Hey I need some guidance on my next project.
I am planning to make a desktop app using electron to manage finances, manage inventory & track orders so I need this desktop app to have a local database but I don't want other people to install any kind of external database software it should be like packaged within the app itself , and also this desktop app should be connected with some kind of online database (more on this later). And I also have made an android app to manage the end customer and provide them with regular updates and also collect data from them. Till now I have been using Google sheets and a web app to manage everything but this has recently become really problematic (many many issues) So I need to deploy my own database (local server or online server basically anywhere possible) and this has to be connected with my the electron app and the android app
.
.
So basically 3 things
=> a desktop app with a embedded database & also linked to a online database
=> A android app which is connected to the online database
=> and the database itself Which manages all the data from the android app user and the desktop app user
.
.
I have created the android app & also making the electron app seems doable BUT the embedded database & server database part seems really confusing and I have no clue what to do or where to start (the reason I picked electron for the desktop app is because I am really familiar with Javascript, HTML & CSS)
.
So I need some guidance (maybe alot) to make this happen
Is it possible to bundle a flask application inside electron??
Also looking for a fix for the require not defined. I know this is an issue with Electon V5, specifically with NodeIntegration being false, but even when I turn it to true (and ContextIsolation to true just in case), I get no results. Very little info out there on the web too since v5 is relatively new and this is seemingly a big change.
Any help would be greatly appreciated!
Whether it's linux, mac or pc, after building the app to an .exe, does the end-user have to install electron or python for this to work?
Or is the .exe file itself an install file rather than a portable .exe, that will install any (server-side) software needed to run?
But can we compile this to become an app? Will the python program still run when we export electronjs to .exe or .app?
Hi, I want to create a frontend UI which can run bash script in background and show output in that UI, How can I make it , any guidance
Did you try to use .send() and .receive() from python-shell? Not that Flask is a bad solution, but it seems like you could have used python-shell for Object Detection, as well. I'm curious to know if you tried that but ran into problems.
I did try that, but like I said in the video, whenever I start the object detection code, it takes a long time to initialize and load the model. That's why I used flask, that way the model is always in memory
Very Good really interesting.....
browser console error is "require is not defined " can anyone help
it isn't working in electron window
You do not have all files in the GitHub repo....please add them
It's all there. I recently removed the face recognition part due to some technical reasons. If you want those files, you can get them from an earlier commit
I am getting an error,
require is not defined (uncaught reference error)
i dont understand , is he changing the image file to bytes can't we just pass in the image value .... someone please help