AI on the Jetson Nano LESSON 8: Installing a Good Python IDE Environment, Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Palma quarter from top tech boy comm and we are here today with lesson number eight in our incredible new tutorial series where you are gonna learn artificial intelligence on the jets and nano what I will need you to do is pour yourself a most large mug of iced coffee and I will need you to get out your Jetson nano gear and get it all booted up if you haven't gotten your gear yet look at the links down in the description I show you the hardware you can get it there on Amazon and get exactly the same hardware that I'm using and while you're getting your gear up and booted up I want to take a second to thank you guys give a shout-out to you guys who are supporting me over on patreon really appreciate it it's a huge encouragement to me to have you guys actually be a part of this channel so really appreciate it if you aren't helping out yet think about hooking a brother up there's a link to my patreon account down in the description to this video but enough of this nonsense where I talk about my patreon account let's get in and let's start learning something good today what we are going to do today is we are going to install a really nice Python integrated development environment now we've done 2 or 3 lessons already on Python and what we have done so far is to use the text editor Nano and to just edit a text file to create a Python program and then run that text file it's good to know how to do that old-school but now as we're going to start moving to more sophisticated programs you need a good integrated development environment now the integrated development environment that I would like to use on the PC is pycharm and it does all types of cool stuff but I was unable to get patch arm to work correctly on the Jetson Nano it just wants to create these virtual environments and then those virtual environments tend to kind of mess up the operating system image that we got from Nvidia and so what I found is it's just better not to use PyCharm what we are going to use is known as code OSS or Visual Studio code that kind of long name is Visual Studio code so it's almost identical to PyCharm but it runs under just the default installation of Python so it doesn't goof up the way that that operating system image is configured and I I really think this is the best way to do it and i really suggest if you're gonna follow these tutorials that you play along with me using the same operating system in the same development environment that i'm using okay let's see how we do this i probably need to get out of your way here and then what we're going to do is we are going to have you open up a linux terminal and let me move this around a little bit where i can optimize your views so you can see exactly what i'm doing ok now we want to install code OSS and we're gonna get it configured in today's lesson but to start with what we are going to need is we're going to need a helper program that will allow us to do that and for that helper program to work we have to make sure that you are all updated so i need you to do a sudo apt-get update just to make sure that you are up to where I am we see that that like that command it's going out and it is getting everything updated I've updated it recently so it shouldn't take too long there we are I also need to make sure you can see the bottom of my screen ok there I think you can see that real well now ok so our system is updated now if I do an LS you can see that I am in my home directory to get there remember you can do a CD space what's the shortcut to the home directory these squiggly so if I go CD space squiggly that'll get you there and then if we do an LS you can see that there is a downloads folder so we're gonna want to go down into that CD downloads alright and now we are in downloads and that is empty ok now the we got to get a program now that will help us install visual studio code and that helper program is Curl so we need to go get curls so we're gonna say sudo apt-get install Perl boom it looks like it's finding it are you sure you want to continue yes I want to continue okay this will probably just take a couple of minutes to get downloaded and since you're having to wait and I'm having to wait we might as well chat I don't like to pause the video and restart and pause and restart hey man if we're waiting we might as well chat as we are waiting for that that was pretty quick it looks like curl is working okay now you guys know how I always tell you never copy and paste what I'm doing and just always type the commands and type the things yourself so that you will understand I am going to give you a reprieve on this one command and if you will look down in the description down below in the description of this video right below the link to my patreon account right in the next section I'm gonna put this command because I don't want you to try to be a hero and actually type this in yourself and so you can get this in the description it's curl - all space HTTP then it goes to the github and then it has a really low lot long file name and then the - o means output it to code OSS 1.3 2.3 - arm 64 - Deb I don't think any mere mortal could type that in without making a mistake and so you can copy and paste that from the description paste it and then hit enter and let's see I thought I hit enter let me try again maybe I hit shift oh there it goes boom it looks like magic is happening and it is getting curl installed there force okay we'll give it a second here alright so let me kind of tell you where we're going with this channel we're gonna get our really cool slick integrated development environment installed today we're gonna do a little bit to tweak it and get it configured where it looks really good then we're gonna kind of get it organized and ready to go so that's what our goal is for for today is to get a good Python in an integrated development environment installed and then where we're going to be going from here would be we're heading towards we're heading towards artificial intelligence but the thing to understand is artificial intelligence is really about dealing with very large data sets and a lot of these data sets are in the form of arrays and so if you think about a picture a picture is a huge two dimensional array where you have lots of columns and lots of rows and then each position row column position has three numbers like grid strength green strength and blue strength and so a picture is just a massive array so we've got to get good at dealing with arrays and then also we've got to get where we can look at pictures I mean where we can look at data so we're gathering all this data in the data is typically these huge matrices and you can't just do a print and print out like you know on a raid that's two-dimensional with thousands and thousands of data points it means nothing so we've got to be able to plot data so what we're gonna do in the next lesson is we're gonna install matplotlib which is a graphing program that will allow us to look at data and numpy which is a library that allows us to deal with arrays so in the next lesson we're going to install and kind of get comfortable with numpy and matplotlib and that'll be the tools that we need to deal with very large data sets after that what we are going to do is we are then going to go in and install OpenCV and OpenCV is the package that where we will actually start doing the artificial intelligence I'll tell you guys I am really excited because I'm kind of like working ahead and the things that I'm getting the Jetson Nano to do are quite exciting so I really look forward to it but it looks like our our program has installed so we've got the curl going and now what we need to do is we need to tap the command so your one command reprieve is over for copying and pasting you're going to go back and start typing things in yourself now so you're gonna say pseudo Dee pkg pseudo dpkg - I and then code code OSS underscore one okay so pseudo dpkg space minus i space code - OSS underscore 1.3 2.3 - a are m64 dot DB okay that's kind of like the last part of that last that last curl command that we gave okay so that's sudo space dpkg space minus i space code - OSS underscore 1.3 to 0.3 - a RM 6 for dashdb hold your breath hey looks like it is installing ok we're having a little success here we are installing code OSS that is really slick ok so like I say we're gonna get this up and running today and then we are vectoring very quickly towards the opencv whereas which is where the magic really happens ok it looks like that installed now this is how we can see if it actually installed we can type now let's see I'm gonna come up here to the little Start menu in the upper right and let's see if it can find code okay there it is code OSS you see that I'm gonna grab that icon and I'm gonna pull it over and I'm gonna put it here in my Start menu ok and now I should be able to just start it with this little blue icon did you see that I can start it now with the little blue icon now you can start it by just putting code - OSS and do it from the command line but since this is a program we're gonna be doing a lot I am going to go ahead and I am going to start it from here so we're gonna need to hold our breath is it going to run yeah it looks like it's going to open up and this is actually very exciting okay so we got this thing open up now what we're gonna need to do is we're gonna need to configure it and I'm gonna try to get a nice view for you guys here that looks really good okay oh let me let's see let me show you let me show you one thing do you guys have these icons do you have this menu bar here at the top of your windows I'm not sure if I showed you how to do this your menu bars might be up here so let me show you how to do that we're gonna come to setup I might have to hunt for it a little bit but let me look at appearance and let me look at behavior okay show the menus for a window in the windows title bar and always display do you see how I have that let me show you that again so we're gonna come to settings system settings there then we're going to go to appearance and then we're gonna go to behavior and you want the menus for a window in the windows title bar and always displayed okay because I found it very confusing when they kind of have them hidden up here and sometimes I find myself searching for them so I just want to do that so yours looks exactly the way mine does and you guys won't get confused okay so now what we need is we need to create a folder where we're gonna keep all of our Python files and within this folder we can have different folders for different types of programs but we need to fart we need to we need to start by creating that folder on the desktop so I'm gonna right mouse click you don't have to put it on the desktop but an important folder like this I am going to put it on the desktop so I I right mouse click and I say new folder and then I'm going to call it PI pro 4 PI programs and I'm gonna say create ok and there we've got PI pro now I'm going to come back to my Visual Studio code and I am going to open up that folder so everything is going to happen in that folder so I'm going to to file and then I am going to say open the folder and then I'm going to go to desktop and there's my PI pro folder and then I'm gonna come down I might need to get out of your way a little bit more okay I'm gonna come down and I am going to say click on PI pro and click OK alright now you see it's going out and thinking in churning and now here is my PI pro folder over here now in case you don't see this exactly you can get to the foul Explorer by clicking this upper left right so if you're like this you come to the upper left and now I've got a little navigator view where I can keep things organized like here's my PI pro folder I can click on it you can see it's empty that's ok because we are just getting started so alright we've got a window where we're gonna keep all of our all of our programs you also notice there's a little plus here so I could say plus and I could add a I could add another I could add a a program here if I wanted to okay but I don't want to get ahead of ourselves there the next thing I want to do is I want to set this up for Python so come over to this little extensions icon do you see this come over there and click on it ok and now it's asking me for to search on something so I want to search on Python ok and then if you look at the first response that I get back it says python 2019 and then it says linting debugging and all that sort of stuff I'm gonna say install there ok if I come over here it is thinking you got to give it a second like you can see up here how it's sort of scrolling across there will give it a chance to get completely installed it's still st. saying installing ok that installed successfully good we are moving right along okay I'm gonna go back to this slightly better view and okay I've got my I have got my Python where it knows that I'm gonna be running to run Python I think I'll come back and click on the file explorer again to take me back to the FAL Explorer view then this extensions Python tab do you see how it's a tab I'm gonna go ahead and close that because I've done the installation so I'm going to close that tab all right now if you look here and it says show all commands how do we show all commands it's ctrl + Shift + P at the same time so I want to go ctrl shift + P all at the same time and now I can uh I can put in the command that I want to look for and it is select space in Terp printer select interpreter okay so you see how it found this command Python select interpreter I'm gonna click on that okay and scared me a little bit because it didn't jump right up but this is really really important we want to be operating on Python three point six point eight 64-bit so I'm gonna click on that one okay and that looks like it took that so that looks really good okay couple of things now for me this is not very readable I want something a little bit higher contrast so I'm going to come up to file okay I'm gonna click on file here and then I'm gonna look at preferences and under preferences there's a color theme okay and I'm gonna come to the let's see there's two lights here I'm gonna look at visual studio light okay and that looks I'm gonna look at the other one still a little low contrast so I'm gonna come to preferences and color theme and I'm gonna try light Plus which is light default okay those look about the same but that to me is going to be a lot more readable now one of the problems that we have here is we're gonna have the font is too small for you guys to see so if I'm banging it out here and you guys can play around with the style that you want come back to preferences and look at the color theme and you can see there's a lot of different color themes and you can pick the one that you like but the thing for me is a lot of these are low contrast and for it to be easy for you to watch me do I want to set it to a high contrast one so I'm gonna come to file and then I'm gonna come to preferences and color theme and I'm gonna go back to this I just can't I'm gonna try this one quiet light and see what that is no they're all about the same so I'm gonna put it on color theme and just the light Visual Studio and I think that'll work now the other problem that you're going to see here is is that do you notice over there the fonts are small so I need to make the fonts larger where you can see it well so I'm going to come to preferences and here I'm just going to go to settings okay and then on the text editor I'm gonna come down and let's see I'm gonna click on font here and you see how the font is 14 I'm gonna go ahead and set that at about 24 and then let's see if I need to click OK anywhere no it looks like it'll just take it okay and then I'm gonna close this and I think now I should have a big font when I when I open this up if not we will fix it okay so now we should have this thing ready to go and remember we're gonna be working inside of Pi Pro so I can click here for a new file or hey I could do a new folder I think I will I think I'm gonna go ahead and make a new folder and so I'm just gonna say basics because we can kind of put our basic I basic work in here and then later like we'll have one for OpenCV and so now I'm gonna click enter and let's see I've got a folder called basic and now I want to work inside of basics so I'm gonna right mouse click on basic and now I am going to say right mouse click on basic and I want a new file and now I'm gonna say hello hello world and remember the subscript is important or the the extension is important so we're gonna put hello world dot PI for Python okay and now I'm gonna click enter alright and now look over here I am now here okay it says linter pilant is not installed installed and so that is kind of a nice one so let's go ahead and click install there okay okay don't worry about it right now because we don't really need that so let's just click kill that what it's saying is it's saying that pip isn't installed and we're not going to use pip right now and so we are just going to go without winter and that is absolutely fine absolutely fine so here we are in hello world and so we are going to say print open and then we're going to say hello world okay and so we have a one line program and now if I've just come over here and I say right mouse click you come down to run Python in terminal ok look at that and it says hello world also if you look at this you notice how it says user slash bin slash Python 3 that's really good news because that is saying that we are running on Python 3 and so that is really good and you notice that we got the hello world boom so we are up and running and now we have got a nice development environment in which to work let me get this exactly where you can see it we've got a nice development environment in which to work we've got it configured pretty well we've got a pretty good pretty good color scheme so that really looks good okay let's just do a quick program here let's see let's come over in the basics and say new file and this time let's say user input PI user input dot PI py ok now notice how we can have two programs open at once I've got the hello world and I can come over here to user input and I could say my num is equal to int + int of what I want to make an integer of my input and then I'm gonna say please now notice how when I did the open parentheses it all automatically closed it for me also notice when I did the open quote it automatically closed it for me so it's kind of helping me keep the parentheses and the quotes match matching so please input a number and then that and that okay and now I can just right arrow and then enter and then I want to say for I in range do you see how it's trying to kind of help me type here okay and then I'm gonna go open and I'll say start at 0 go to go to my num and then go in steps of 1 and then I'm gonna go over and then I'm gonna put my colon for the start of my for loop notice how unlike Nano it comes back and it automatically gives me the tab and then I'm gonna say print and I will say print I and then now I want to indent so I just hit a backspace and it takes that out so I'm out of the for loop and I'll say print that's all folks like that all right and you got to remember that it closes that quote for you and it closes the parentheses for you so don't add an extra one you got to kind of get used to that all right now how do we ok now this business is getting annoying so I'm gonna come down here where it's grabbing at me about linter not being installed I'm gonna say do not show again if we need pip install later I'll install it but for right now don't do it because again we don't want to get our working environment goofed up and so a lot of the stuff we won't be installing with with pips so I'm not going to install pip so I'm gonna say do not show again ok so now how do we run the program we right mouse click and then we say run Python file in terminal ok oh I see I didn't close this out right erase the one that did close it out oh look at this I see what I did I really messed it up did you guys see that right now everything should be balanced control X ah that's not a control X man let me try one more time yet control X I wasn't trying to nano close the Nano ok so now I will say in print open parenthesis open quotes it close them for me that's all folks and exclamation forward over that now what do I do I wrap right mouse click and I say run Python file in terminal please enter a number now you've got to make sure like if I just type a number it's gonna do an edit so you've got to make sure that before you type something you come down and click here so that it gets your input please input a number I'll say 23 and then look at that it counts from what zero all the way to 22 and remember that's that business about how range always stops one before the number that you put in there and so it gave you 23 numbers but it starts with zero and goes to 22 which is 23 numbers we've talked about that a lot just get it in your head that with range it stops one before the number that you put in there okay guys we have written a couple of programs that is really really slick we have our integrated development environment up and running we are working over all inside of our pop pro folder and as we're playing around we are working in the basic folder and then later like when we get to OpenCV we will do that okay I just kind of want to play around here for a second and let's just see kind of thinking towards the future let's come up with a let me just look up here I want to see do we even have any numpy at all install if I say import numpy as NP I don't think that it comes with numpy as configured in Python 3 but let's right mouse click and say run Python file in terminal ok yeah you see numpy is not installed and so we'll have to do that next week next week we're gonna install matplotlib and we're gonna install numpy and next week we're going to start working with a race like how do we deal with array data using numpy and then how do we plot it using that plot lib so next week matplotlib install numpy install and get familiar with those two programs that's what we'll do next week and then the following week we're gonna install OpenCV and OpenCV is the program that allows you to start doing artificial intelligence and so two lessons from now in two weeks what we'll be doing is we'll be firing up the camera inside of OpenCV we will be grabbing images from the camera manipulating them and doing all types of different stuff before we can do that we got to do matplotlib and numpy hey you guys if you like this think about giving us a thumbs up again I really appreciate you helping me on page link down below thinks think about sharing this lesson with other people give me feedback how is this going are you getting some of you guys are getting impatient with me because I'm really showing you every step along the way but I want you to learn this where you can do it yourself the problem is when I go to the nvidia side or some of the other things i'm just copying and pasting them what they're doing and i can do some cool demos but i can't realize my own ideas i'm teaching you so that you will be able to go out and write your own programs okay really appreciate it palma quarter from top tech boy comm i will be talking to you guys later
Info
Channel: Paul McWhorter
Views: 32,701
Rating: undefined out of 5
Keywords: Jetson Nano, Ai, Artificial Intelligence, Tutorial, Lessons, Python, Visual Code Studio
Id: Fegmuh6_mEg
Channel Id: undefined
Length: 29min 29sec (1769 seconds)
Published: Sat Oct 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.