Intro To Kivy - Installing Kivy on Windows - Python Kivy GUI Tutorial #1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's going on guys john elder here from codingme.com and in this video we're gonna start to look at building python gui apps with kivy all right guys like i said in this video we're going to start to look at kivi but before we get started if you like this video you want to see more like it be sure to smash the like button below subscribe to that channel give me a thumbs up for the youtube algorithm and check out kodamy.com where i have dozens of courses with hundreds of videos to teach you to code use coupon code youtube1 to get 30 off memberships all my courses videos and books for one time fee is just 49 which is insanely cheap okay you guys have been asking for this for a long time but now we're finally going to start to learn kivy for python and if you're not familiar kivy is a sort of cross-platform gui app building thing right so kivi apps work great on everything they work on you know windows mac linux android everything they're great cross platform things you build it once works everywhere and it's really cool so in this video we're just going to sort of start to talk about it we're going to install it for windows and build this very very simple just starter app that just says hello world in the middle of it just to get our feet wet and get started from here on out we're going to build out this playlist and do i don't know two or three videos on kivy every week and should be a lot of fun so let's go ahead and close this and let's head over to google and let's just type kivy and you can see here's kivvy.org this is the website and you're going to want to check this website out just a little bit we're not going to spend a lot of time here but click on documentation here and then you can come down here to getting started and we want installation now the problem with ki right off the bat is it's kind of tricky to install and it's different for every platform that you're going to develop on so i'm going to be working on windows so in this video we're going to install for windows if you guys really need help installing this on mac let me know and i'll do a video on mac as well but you can see we've got windows mac linux raspberry pi and android and so we're going to click here to install on windows now this is qb.org docs slash stable slash installation slash installation dash windows.html and you can see it's got instructions for if you're using anaconda i'm just using regular old python which is perfectly fine so we don't need that so let's come down here we want the stable release and it says ensure you have the latest pip and all that good stuff installed of course we do i'm going to assume we do like i said i'm going to assume that you already have python installed on your computer if you don't then go ahead and check the channel i've got tons of videos on installing python i'm going to be using the sublime text editor and the git bash terminal as always also if you don't have those installed and don't know how to install them check my channel i've got tons of videos on how to do that now we're going to want to install or we're going to want to create a virtual environment so let's do that right off the bat so i've opened a git bash terminal and the first thing we want to do is create a directory where we're going to hold all of our ki files and stuff so let's go mkdir and i want to put this in my c drive and i'm going to call this kibi gui call it anything you want really and now we want to move into that directory so cd change directory and to see heavy gui and you can see here we are now we're in there and if we type ls there's nothing in this directory so the first thing we want to do is create a virtual environment so i'm going to go python dash m v e v stands for virtual environment and now let's name this thing and i'm going to just name it vert short for virtual this will spin up our virtual environment okay now if we type in ls we can see there's this vert directory so to turn this on i'm going to type source vert scripts activate okay and now you can see when i hit enter a bunch of times we see this vert above our terminal prompt here right that means our virtual environment has been turned on so now we can pip freeze to see what has been installed inside of our virtual environment python wise and it returns nothing so there's nothing that's been installed python wise into our virtual environment but now we can start to install kibi let's head back over here and these are the instructions for what we just did for the virtual environment stuff i changed them around a little bit but basically the same thing we're setting up a virtual environment so now we need to install the just the dependencies and kb comes with all kinds of stuff that we're going to need and so we're just going to go ahead and install these things so i'm going to copy each of these highlight copy head back over to our terminal and right click paste enter it's collecting all the stuff and while it's doing its thing we can come back here and copy this one and you'll notice it has a little note here if you encounter a memory error while installing then you can use this no cache dir option you just slap this little flag at the end of this thing put a space and then the flag and that should be fine it also says if you have python 3.5 or up which you probably should be we're on what 3.9 by now something like that you can do this instead of this but we don't really care right now we're just gonna do the defaults so okay let's copy this one that other one should be done by now hopefully okay so now we can paste in the next one pip m python dash m pip install qv depths g streamer point 0.1 and while it does its thing come back here and look at the website and so now we've got the dependencies the things that kivi needs to run now we can just install qb itself so i'm going to copy this and this is going to install kv version 1.11.1 if this changes by the time you watch this video whatever no big deal just go ahead and install whatever they're recommending as the latest version all right so i'm going to go ahead and clear the screen and then let's paste in this one so pip so python dash m pip install kibi equals 1.11.1 and so it's collecting kibi and it's doing all the things and you can see it's grabbing all kinds of other stuff too so all right now let's pip freeze just to see what everything has been installed here and you can see now we've got a bunch of stuff installed inside our virtual environment and this has only been installed inside of our virtual environment so you can see there's some different things kiwi garden and let's see pi 132 heavy itself right there okay so now if we type in ls there's still nothing else in here but our virtual environment stuff and we're good to go so that's pretty much all we need to install kibi now let's just build a very very simple little app just to get our feet wet here and so i'm going to come up here and i've opened a sublime text editor file so let's go to file save as and we want to navigate to our c drive so i'm going to go to this pc c find our qivi directory that we created earlier so that was kivy gui right there and inside of here i'm just going to save this as hello dot pi and qv files are python files so they all end in dot pi so right off the bat let's import kibi and then we also from kivy.app oops we want to import app oops that needs to be capital a there we go and then finally from kivy.ui dot label we want to import label and oops every time i hit enter it wants to lower case those make sure these are both uppercase right so i'm not gonna get into what all this stuff is right now in this video we're just sort of getting this set set up and doing a very very basic app but with kivy you're importing lots of stuff all the time you can see we want to do a little label so we have to import the label thing from the kivi uix thing right and i know we imported kivy here so you're like oh don't i get everything well we still need to import individual things it's just how this works so let's start off by creating a class and i'm going to call this my app and this inherits app and that comes from up here so the app is the sort of main it's our app right it's our main thing so we're going to create a class of app now inside of here we want to define build and we want to pass self and then what do we want to do well let's return a label and we want the text to equal let's say hello world and that's good so that's our basic app so now we need to sort of instantiate this thing and so let's go if underscore underscore name underscore underscore equals double equal to sign and then we want underscore underscore main underscore underscore then we want to run my app and we dot run this all right so this is the bare bones sort of thing that you need to get a very basic app running in kiwi we create a class we can set a label we're getting this label right here from this guy right here that we imported and then here we're just running it basically so let's go ahead and save this hello.pi let's head back over to our terminal make sure we're in this directory so let's clear the screen and let's run this so python hello dot pi if you're on a mac i think it's kivy hello dot pi uh and you can see boom it's doing all kinds of stuff here which is a little weird and then boom we get our app and this is just a very basic app says hello world in tiny little letters and it works so if you see that congratulations you got your first kibby app up and running uh we could play around with this just a little bit like i said i don't want to get into great detail on what all this stuff is but we can give this a font underscore size equals let's say 72 make the font really big we can come back over here and run this guy again and now our text is really big right and you see if we resize this our text sort of resizes as well it doesn't resize but it moves right so this is sort of dynamically changing this app if this was kinter and we went like this the hello world text would be off the screen it wouldn't sort of dynamically move the text so that it's always in the center so right away kiwi is looking better than like a basic kinter app and uh pretty cool so that's how to install qb on windows not that difficult i definitely suggest that you use a virtual environment anytime you do anything with python you should really create a virtual environment and especially with kibi because you know there's lots of dependencies and things that are installed with kibi and have those all sort of corralled inside of a virtual environment is always going to be better in case you need to update different versions of the dependencies or if you need to update kivi itself to a later version much easier to do that inside of a virtual environment than to just have it in the general area of your computer and who knows what it's knocking against with other things that are installed so uh pretty cool and pretty easy so that's all for this video if you like to be sure to smash the like button below subscribe to the channel give me a thumbs up for the youtube algorithm and check out codaby.com where you can use coupon code youtube1 to get 30 membership so you pay just 49 to access all my courses over 47 courses hundreds of videos in the pdfs of all my bestselling coding books join over a hundred thousand students learning to code just like you my name is john elder from coding.com and i'll see in the next video
Info
Channel: Codemy.com
Views: 119,054
Rating: undefined out of 5
Keywords: Kivy, python kivy, kivy python, installing kivy, installing kivy on windows, installing kivy on windows 10, installing kivy in python 3.8, installing kivy with pip, kivy tutorial python, how to install kivy, kivy tutorial for beginners, python kivy tutorial, kivy install, install kivy, kivy python tutorial, kivy tutorial, python gui frameworks, kivy apps, kivy tutorials, kivy designer, kivy course, kivy tutorial #1, python gui builder
Id: dLgquj0c5_U
Channel Id: undefined
Length: 11min 13sec (673 seconds)
Published: Tue Oct 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.