 All right, does anybody have anything? Yeah, they wanted to ask about or talk about or anything else before? I had a quick question. Yeah. At least I hope it's quick. When we were talking yesterday and I asked you about the environments, you seemed to feel very strongly that you should work in the base environment. And I've been rolling it over in my head. And I'm just, when I think about the mistakes that I've made and how I've screwed up environments and gotten conflicts and stuff like that, I was wondering why you feel so strongly about that. Sure, I mean, we'll talk about it more when we kind of get to environments, but so because we haven't discussed them yet. But briefly, environments are basically separate folders with separate installations of Python and Python libraries and so forth. They're often used for kind of keeping separate projects separated with different sets of kind of dependencies or versions of Python or whatever. And they certainly have a role to play for advanced users. I almost never use them. I mean, very, very occasionally use them. But my feeling is the most important thing is to be able to rapidly iterate and experiment. And I kind of want my projects to live together as a whole, as a bunch of things which all help each other and come together. So I don't like the idea of like, oh, I'm working on this project now. I go over there and everything's kind of new, you know? So instead, I really like to get very fast and very good at just quickly just going RM minus RF mini forge and it's gone and run setup condo.sh and it's back and have a single script that if I need one, normally don't even need a script. I'll just go member install minus C fast-chan fast book and that installs everything that I need and I'll go. So I kind of like never want to be in a situation where anything on my computer is, I don't really like it's working but I don't know how I got to a point that it's working and I don't want to touch anything lest I undo that, you know? So I'm more in the kind of chaos monkey side of like explode things from time to time intentionally and to be really good at putting them back to where they were, I guess. And yeah, so nowadays I never have problems, basically with dependencies or weird things going on in Python or whatever because I just from time, you know, like probably every few weeks I'll just throw it away and clean install it just to try something out for teaching or whatever. I always feel fine. You know, this morning I did use an environment because I specifically wanted to test something on a different version of Python and I wanted to check that it would install into somebody's fresh new environment. And so I used it for that. I think it's useful if you are like installing some library where they've done a poor job of keeping their dependencies up to date. So you need like Python 3.6 and sentence p1.8 and I don't know old versions of things in which case you wanna be able to go pit-requirements.txt and get all these exact versions of things. But my approach is to, for my projects is to not pin versions, not pin dependencies. I wanna anybody to be able to install my work into whatever they're doing and work with all their other programs that they're running in libraries that they're using without anything getting messed up. Unfortunately, not everybody works that way but that's how I try to make other people's life easier and so therefore any programs you use from me you'll be able to install into your base environment without messing anything up or install into any environment without messing things up. And when, sorry, just a quick follow-up. If you're installing into like a new computer or whatever, would you install Fastbook or would you install Fast AI? It depends. I would just probably install Fastbook because Fastbook installs Fast AI which installs NumPy pandas with a Matplot lib. It also installs Transformers. It also installs data sets. It also installs sentence piece. Maybe it doesn't install the sentence piece. I think everything except sentence piece maybe. There's no reason it shouldn't install sentence piece. I should fix that. So it didn't yesterday. Yeah, I didn't yesterday. I was just remembering that. So Jeremy. Yeah. So if you're blowing it away and you're basically using a new iOS installers as like people do with environments, how are you keeping track of your things like RSA keys, etc. How are you not blowing those away? Those are not part of a country environment. So that's fine. They sit there in my home directory. It's just that many forge directory or many con directory or anaconda directory, depending on what you're using. I just delete that. Cool. Jeremy, you talked about uninstalling always, right, in this base environment. So yesterday I was trying to, I messed up one of the dependencies. So what are the steps for uninstalling usually? I know. So do you want to start? Go to your home directory and type rm-rf-mamba-forge. Only that is recorded. Okay. I try that. And then close your terminal and reopen it because I remember the other day Ashie didn't do that step and so I didn't install properly. Yeah. I'll show you a quick trick. Yeah. So this is sorry. This is a little more advanced than normal, but that's okay. So this is slightly confusing, but the fastbrook pipi and condo installer actually comes from a repo code course 20 and it's here. It doesn't really contain any code. It contains a few utils, but that's actually like search images being, but you know, this has got nothing to do with what we're using it for, something that returns an image of a cat. But actually the key thing is it's got a settings.ini file, which contains a list of requirements. And so if I now put this up on pypy and condo, then if I say condo install or pip install fastbrook, then that's one quick way of just getting all these or you could create a tiny little script that goes condo install and then with these things in it. But yeah, you want some way to get yourself into the basics set up instantly. Oh, here we are. This is why it didn't give me sentence piece. Sentence piece only comes with pip. And that's cause when I set this up, I didn't have fastchan and so I didn't have sentence piece in condo. So. Jeremy, I think you've got minimum Python there 3.6, but I think fastai repo has 3.7. Yeah, yeah, that's right, which I suspect it probably overrides. But yeah, so here's a good use of the GitHub GUI, right? I want to just change it while I'm looking at it. And we're done. Cool. Yeah. Okay. So that was a good question. And at some point I'm sure we'll need to create an environment for something and we'll talk more about that. I guess like maybe something else, just while we're here since we are, as I said, this is a bit more advanced and people can totally skip this, but just, I mean, it's probably worth understanding what condo slash member is and how it works, right? So remember the other day, I typed which Python and I saw that I'm getting, that Python is coming from this directory. So like one obvious question is, well, how does, why is it coming from this directory? And the reason why it's coming from this directory is, let me just open up this a bit more so I can see more people, there we go, is that Linux, I mean, I shouldn't say Linux, bash and pretty much all shells. So they use the concept of something called the path and the path is the list of places to look for programs to run. And the path lives in something called an environment variable. And an environment variable is just like a Python variable, but it's a variable that lives in your shell and you can print them out. So instead of print in your shell, you type echo and then an environment variable, normally if I just say echo something, it just prints it, right? So if I want to echo the contents of an environment variable, I have to put dollar before a dollar means this is a variable that I'm printing. And so the variable path, there it is, right? And so you can see that this is a string, a colon separated string. And in my colon separated string, there's something which is home, J-Hard, member, forge, bin. And so that directory, if we take a look at it, contains lots of programs and one of those programs is pi, pi, Python, okay? So that's why it is when I type Python that, I'm sorry, I didn't mean to do that. When I type Python, that's the Python that it runs. So here's a little trick. I wanna type rich Python and I'm so lazy, I couldn't have even bothered typing Python. So if you remember double exclamation mark means the previous command. So that's gonna be which Python. So it's worth looking and seeing like, well, what is this member forge directory? So the member forge directory, for those of you that have kind of seen UNIX type directories before, it contains a bin directory and an et cetera directory and a lib directory. And this is basically looks very similar to my Ubuntu's root directory. And so basically, a condor or a member forge or whatever root directory is kind of a copy of a Linux or even actually a Mac root directory. Contains very similar things, et cetera user so forth. And what happens is that the thing that it puts into our bash RC, so remember our dot bash RC is the script that automatically gets run, this thing here. Basically, it runs a little shell script that sets some environment variables and one of the environment variables that sets, for example, is the path environment variable and it adds this to path. It does something similar to kind of make all the libraries work as well. And so we mentioned how you can create a totally separate environment, a totally separate place you can work that has its own copy of Python and libraries and stuff. The way you do that is you go, member create minus N, give it a name and then say, what do you wanna have in it? So let's say, okay, I wanna have Python in it. I don't normally like to have, I don't normally like to have the latest Python so let's get something before 3.10 and I also want fast work in it. So that's gonna create, so you can go member create or condo create. Actually, I already have that because I used it this morning, as I mentioned, so I'll remove that automatically and create a new one. And so that's going to set up a new environment which we will take a look at. So currently what it's doing is it's downloading from the internet a list of all of the condo packages that are available from a channel called condo forge, which is the main channel that member forge uses. And it says, okay, I'm gonna install Python and Fastcore to install those things. I'm gonna need these other things as well. That sounds fine. You'll see it's cached. So basically one of the nice things about member and condo is that it kind of saves the archives that you've downloaded. It doesn't have to re-download them. So as it now says, you can activate this environment by typing member activate temp or condo activate temp. So that's changed my shell. If I now say which Python, it's getting it from as new place and it's getting it from the same place as before, home J Howard member forge, but it's now getting it from M's temp. And that's because this member forge directory has a directory called M's. And that M's directory is a folder that contains each of those environments. And it's really interesting to see what's in them. Because look, it's yet another copy of the kind of things you would see in the root of a Linux installation. So that's why it works, right? It's basically yet another copy. So for example, we'll see that in M's temp bin, here's another copy of Python. So if I type Python, it's running that Python and it's got its own set of libraries. So it's using those libraries. So it's, yeah, it's really neat. And you can install compilers. You can install any binaries you like. You can install rusts, you know, separate copy of Jupiter, whatever. You know, by the way, something that's quite neat, not as important as it used to be, but these are actually using something called hard links to create these. So they're actually not even separate copies. So it's like not even using disk space. So yeah, the whole thing is really quite nifty. So yeah, so basically when you go activate, it's, in fact, let's take a look at my path. It changes my path, see? So now this comes first. We could look at hard links. So I find hard links quite useful for myself when I have a lot of data in a folder and I want to run something on this data from another place. I just create the hard link. So you create some links or hard links because normally you'd use similar links for that. Yes, that's the word. That's the rogue expression. I create some links. Yes, some links. Yeah, yeah, yeah, we will get to some links. Let's wait until we kind of need them, maybe. Yeah. Interesting. Okay, so to go back to activating the base directory, I just type condo activate. Now I'm back in my main environment. So yeah, hopefully that explains a little bit about what environments and why you might use them. You know, there's a certain way of developing software which is particularly common in the JavaScript world where you freeze the exact versions of everything at a particular point in time. And so you end up with things like, you know, well in the Ruby world, you end up with a gem.lock file in the Python world, you end up with a requirements.txt file in the JavaScript world, you end up with your packages.json file. You know, this is something that I would strongly recommend trying to avoid as a data scientist when you freeze particular version numbers. It makes it almost impossible to mix and match things in different places. You know, this library from here and this thing from here. And, you know, you end up going into this huge complex ecosystem of Docker containers and, you know, trying to find ways to make that all work can get quite overwhelming. And you can actually entirely avoid it by just, you know, using a single base environment and keeping your libraries up to date and having good tests and knowing when a release has broken something and so forth. You know, it's not always the way but this is my suggestion for, you know, rapid iteration data science is to do things this particular way. All right, so then that's, we've got, we've got our own computer running and it's nice to be able to use Python on your own computer because, you know, you can rip it out a laptop anywhere. Don't have to be on the internet. You don't have to start a server somewhere. It's, you know, it's nice to be able to quickly play with things. And, you know, I think like ideally a large amount of the time you're not using the GPU because a large amount of the time hopefully you're like exploring results or you're testing out things and really small samples that don't need a GPU or, you know, hopefully you can do a lot of stuff on your computer. At some point, you need a GPU and my view is that you should try to use a GPU in a way that feels as much like your computer as possible but doesn't cost you much if any money. So at the moment, my view is by far the best option for that is paper space. Paper space is actually a company that have a few different products and specifically it's a product called Gradient. Gradient is, in fact, specifically it's Gradient Notebooks. Let's keep going deeper, Gradient Notebooks. So Gradient Notebooks is basically something where you can get a free GPU server which behaves a lot like what we've just been working with. You know, you'll get a terminal and all that stuff. So let me sign in. OK, so paper space has this concept of projects. I have no idea what they're useful for. I just have one project. So I'll just go ahead and click on it. They're just the other things that contain your they call them notebooks, but these are basically servers, right? These are some servers. Now, I there's a few options for like paying their money and if you can afford it, you know, this is such a good deal, the eight dollars a month not only because as you'll see, you get some pretty good GPU options and you can keep things private, but you also get more persistent storage. So that means you can store things between sessions. Now, the reason this is really important is because these aren't actually my servers. Paper space has not put aside servers to me to use. These are kind of small little saved snapshots, basically. And it's going to kind of create a new computer each time I fire one of these up. And so it's really nice that as you go from, you know, instance to instance to be able to access the same files each time. So let's start from scratch, because that's what we're doing. OK, so it's a select a runtime. Basically, what this is going to do is it's just going to pre populate your server with some files. And so if you choose the fast AI one, then you'll have the main stuff, you know, basically everything you need for the book pre installed. So let's do that. And so, as you can see, there's various free options and various paid options. So I'll use there. So basically, you know, important things to know about is how many how big is the GPU? These are all pretty good. Eight or sixteen is this great. Sixteen is obviously better. And then how fast is it? P that that'll probably be a Pascal card. So that's a couple of generations old. So it's like quite a lot slower than modern cards. RTX is totally up to date card. But this one's got a lot more GPU. So I'm just going to pick this one six hours. So it's going to, you know, if you're paying for it, make sure you've got all those shut down set to something sane. Otherwise, you'll end up paying for it for a long time. You can easily share notebooks with other people by turning public access on, which is by default. There's a few advanced options here. I don't think we particularly need to touch them, to be honest. One thing I'm just going to note now is that it's going to run a command called run.sh. So just note that down because we're going to check it out later. And you'll also see it's actually going to. Clone or get repo. So I mean, one thing you could do is if you've got a fork of fast book, then replace fast AI with your username and you're going to get your your forked version. OK, so I'll start. So yeah, so I don't know. I find this a bit confusing that it says notebook. It's it's not a notebook, right? It's starting a server for us. And that server is going to run. Do you put a notebook automatically? So the thing that appears here is. The paper space. GUI. I don't love it, honestly. So I. Don't really use it very much. The one thing that you do particularly want it for, though, is to be able to stop your server when you're finished, especially if you're paying for it. But I mean, you should do it anyway because there's no points using their server hours. So what I'm going to do is I'm going to just copy this URL and create a second tab and paste it just so that I've got two versions of that. So this one here is going to be sitting here and I can go back to it and click stop later. In fact, when I close this tab, it'll remind me that I have to click stop. So this is a good way to not accidentally forget to stop your server. Do you mean that auto shut down? It happens if you're inactive or that would shut down regardless. It shuts down regardless. Yeah, yeah. So that because that, you know, they don't really know if you're doing things. They don't really have any telemetry or anything. By the way, this five hours seems to be truncated down. So it's actually 5.9 hours, you know. That's just something I noticed. It's a bit of a bug, I guess. Yeah, so in five hours time, it's going to shut down regardless. Five and, you know, hours and fifty-five hours time it's going to shut down regardless. So the first thing I do actually is I click this button, which gives us proper JupyterLab. And then I don't have to use their slightly crummy gooey anymore. And this is also nice because now we're going to be using something that's just like what we have on our computer, which is the goal. OK, so here's JupyterLab. And you can see that the book is here. And yeah, this is basically the Git repo that was automatically filled in for us has been cloned into here. Just what I'm going to do is start a copy of an old machine as well. Not gradient. What am I doing? Gradient because I want to access some files from there. Start machine. OK, so I guess to start with, we could go into clean, open up MNIST basics. So let's see how much they've got installed if it's all ready to go. Let's try running this cell. No, there we go. It looks like it's got everything. Let's try running this cell. Nice. OK, so it's basically got fast book installed and sent in space installed. So that's good. So yeah, we're checking JupyterLab or we're checking the paper space. We are in paper space right now. See, just to remind you, I expect on this button and that gives us JupyterLab in paper space. Thank you. Sorry, I missed that. No, no problem. It's easy to miss things to ask anytime. So one thing that is actually, I find kind of confusing about JupyterLab is it has its own set of tabs and its own interface and it kind of replicates things that could be in a browser. So in a lot of ways, I kind of prefer the old version of Jupyter, Jupyter Classic, which you can always switch to. But you can get used to it. And one thing that helps a lot is if you just full screen this, right, and kind of know the keyboard shortcuts. So control shift left and right square brackets switch between tabs. And that's the main one to know. And control B turns on and off the sidebar. So this way, at least you can like get a nice, you know, good use of the screen, particularly when I click terminal. So if I click terminal here, that's not bad, right? I've got plenty of room to see my terminal. So that's nice. OK, so I don't. Oh, Jeremy, just just on the bottom there, if you want to get rid of those tabs for any reason, is that little switch says simple? Yeah, they'll hide those tabs. Yeah, that actually gets rid of the tabs as well, which I'm actually using the tabs. But what you can do is you can go remove status bar. It gets you a bit more room as well. So, yeah, now we've actually doing pretty well. And one particularly nice thing, and you put it by the way, is it actually has a graphical debugger which, you know, so if we go for I in range 10 print I, and then we turn on the debugger with this little button here. So we can turn this, we can put a break point here on and off. Let us clicking. And so now if I run this cell, you'll see that it's got a break point, which is very nice. And we can put a little things in here, doesn't it? Why is that? There we go. Music. OK, so you can see like here's I. And so if I now step through this, you better wait to just show what we want. OK, so it's kind of like, yeah, it's it's that's kind of a useful thing to have, I think. Yeah, I guess this would probably be easier if this is actually probably a really good place to not use import star because I don't see an obvious way to only add variables we want to the debugger. So let's restart the kernel to debugger. OK, and then run this cell. There we go, that's much better. So now we can just see that variable changing. You might be wondering why it is that I clearly am not very competent using the graphical debugger. And that's because I don't use it myself because I actually really like the the non graphical debugger, which I'll quickly show you the non graphical debugger you can use anywhere. Jupiter doesn't have to be Jupiter lab. It can be in a terminal or whatever. But inside Jupiter, if you just put percent percent debug at the top of your cell, it runs the the regular Python debugger, which is a it's a rebel rebel print loop based debugger. And you can type H for help to find out what you can do. And basically, you can type just the first letter of any of these if they're unique by first letter. You can see actually the ones which have the first letter. So C is short for continue, H is short for help and is short for next, P is short for print. So the single letter ones are short for like the ones that you use all the time. And I always use the single letters because, you know, why wouldn't you? So, for example, L actually, I'm not really in a file. So that won't work. So let's try, for example, we can do N for next. So that just N goes to the next line. So here we are. So we've now gone into the. This, you know, the code that we have in our cell. So we should now be able to next again. This is really weird. Why is this not must be saying to do. Wonder if this is some weird Jupiter lab thing. Yeah. OK. I think what happened was that because I had used the graphical debugger, it broke the normal debugger. OK, so let's start again. So, so I hit N for next and that's still not really working. OK, no worries. Let's switch to regular Jupiter because I know it'll work there. OK, percent to percent debug for I N range and print I. Now, curious, what if I put this in a function? Yeah, OK, I don't know. I pretty much always debug things that are in functions. So that's what's going on. OK, so. So I create a little function. I put set debugger called the function. And then the first thing I did is I take S steps into the current function. So this is pointing at the thing it's about to run. It's about to run the thing called define F. So we're now inside the definition of F and now it's going to run something for I N range 10. So N is next to and just advances one instruction. So now that I've done that, I should exist. So you can print the contents of something by pressing P and then the thing you want to print. So I is now zero. And so then I can go next. And in fact, you don't even have to type N. If you just hit enter, it re does the last thing you did. So that just jumps to the next line. And so I can be I OK, now it's one. And so you get the idea. So basically, and then I can type L to list the file that I'm currently at. I can also see W to see like what called this, which was actually called in this case by Python or by Jupyter Notebook. So this is how I always debug things. And I'm sure at some point, we'll actually need to debug something. I thought I'd just quickly show you that. Folks here who have used both the graphical and the regular Python debugger, do you have any preferences or anybody here that has just used one or the other and likes it, doesn't like it? I have only used the text debugger. Yeah, I love it. Yeah, it's wonderful, especially learning about, you know, doing the first day of course, you can just put sense trace wherever you'd like and you are immediately transported there. So, for instance, when working on a new architecture, we're implementing some architecture of, I don't know, my own idea or trying to re-implement something. I create my own class and then I can step through the shapes of the tensors. It's just super useful. Yeah, so you mentioned set trace. So, PDB stands for the Python debugger. So, set trace is very useful. It's how you set a breakpoint. It might seem like a weird way to set a breakpoint, but basically if we run this now, we don't even have to say percent-percent debug, it jumps into the debugger immediately after that set trace call. So, you can put that not only in your own Python files, but in Python files that you've installed from Piat-Pork-Honda or whatever and then step through it in the way we just talked about and hit end and start running through and check the values of variables, whatever. Oh, I didn't say how to exit. To exit, you press Q for quick. If you are learning a new library, this is super useful because you just put the library from GitHub, you do PIP-additable install, and then you literally can step into the code that you're reading about. So, like, frame sentences. And also, basically, pretty much every major programming language debugger works the same way. So, you can, yeah, if you're doing C code, there's a debugger called GDB that works the same way. If you're doing Perl code, the Perl debugger works the same way. They all have the same keyboard shortcuts, the same way of working. So, it's skills you can reuse. And that's another thing, like, in general, I really try to avoid, you know, unless they're really, really good, but in general, proprietary tools, I generally avoid instead, try to use tools that I can use everywhere because then I don't have to learn as many things. I can learn a small number of things and reuse them all the time. And particularly, these, like, really old tools like this, the way the Python debugger works goes back a long time, even before Python existed. These tools have been developed over many years to make them really perfect, you know, really to make them work really well by many people. And so, they're very nicely optimized once you learn them. And they do take some time to learn. But if you're doing these walkthroughs, then you're the kind of person who's prepared to put in that time. There's another thing related to what Jeremy just talked about. And those are key bindings in things like T-Max or even in Jupyter Notebook that we're looking at right now. So my normal intuition and what I would do a couple of years ago when I jumped into something new, oh, I would just come up with my own unique key bindings that, hey, they will make life comfortable for Radit, they make it, you know, they're ergonomic and they're easy to remember. But then as you switch to a new environment, you sort of have to bring the key bindings with you, which is a horrible pain. So just like Jeremy mentioned, that she tries to use a software that is readily available. A way to shoot yourself in the foot would be to come up with your intricate key bindings. It's just sometimes very useful to go with the key bindings that are already there. And even more importantly, learning to use the keyboard for everything is a good idea. I tend to use the mouse a little bit for teaching because I want people to see what I'm doing. But in normal life, I hardly ever touch my mouse because I'm just zipping around. So yeah, there's a few tips. Okay, Jeremy, just a question, a slightly on a different topic, but on the same thing, if the library behind this notebook has changed or get upgraded, how do we get the latest? That's what we're gonna do right now, so perfect segue. Okay, so let's say I want to upgrade something or install something in this environment, in this on this paper space server. Now, as we discussed, a paper space server is not really a server at all. And so if I pip or condor install something, it's actually not gonna be here next time I come here. So that's a bit of a bummer. So how do we fix that? We're actually gonna learn a lot in order to fix this. The first thing to know is that paper space has this idea of persistent storage. And specifically, there's a directory called slash storage, which contains your persistent storage. And so as you can see, even though I only just created this server, you know, just now, there's already things in here. And that's because that's my persistent storage. So this is basically a mounted network drive. You can see all of the drives and how much room you've got in each one by using DF, which is disk free. And then if you remember minus H is the human eyes, it tells you sizes in like gigabytes and megabytes and stuff. And so here's a list of all the disks that paper space is provided for me. And so there's one called slash, which has got 168 gigabytes available. And here's my storage, which has got 496 gigabytes available. So that like by default, for free, you get five gig. I just feel pretty good, right? But for eight bucks, you get 15 gig, which is a hell of a lot better. Not all of these are writable. So for example, they have actually a slash data sets thing mounted there for you, which is kind of cool because you can actually start using data sets that's used by FastAI straight away, which is pretty nice. Yeah, they're the main ones, basically. So what are we gonna do about this, you know, slash storage? This is really where we want to install PIP libraries or condo libraries too. So let's, I'm just trying to think, does anybody think of a PIP library they want to install? Any favorite ones? Use something like auto pep eight or Jedi or something like that, just it's, you know, doesn't really do much. I'm sorry, no. Yeah, I was already installed. Maybe we'll just be able to lay this version of Fastcore. Okay, so normally to install the latest version of something, so you can use PIP or condo for this actually, for installing stuff kind of like locally, the way we're describing it, it's actually gonna be easier to use PIP than condo. And so we're gonna be, so we use PIP. In a past lesson, I said like avoid PIP. You know, I think we're down actually at a point where we can talk about where it's okay to use PIP. So PIP is a perfectly good way to install things which just contain Python code or which are kind of pretty self-contained. You wouldn't normally want to PIP install PyTorch because it requires like CUDA and stuff. And yeah, PIP doesn't really have a way of installing those kind of libraries. That's why if you use PIP to install PyTorch, you have to like separately install the NVIDIA software development kit. With condo, you don't have to. But for a library like Fastcore, and in fact, honestly, most libraries, you know, like GPU kind of libraries, PIP's actually fine. And so normally to upgrade software with PIP, you would type PIP minus U and then you type the thing that you wanna upgrade. Or if you just wanna install it, you do it without the minus U. There's an extra flag you can use, which is minus, minus user. And that's gonna install it into your home directory. And so there's lots of reasons you would wanna do that. For example, if you don't have root access or like in our case, we don't have the ability to like save the stuff in the root directory. So if I run that, oh, and of course I have to say install. Okay, so it's upgraded it from 1.4.2 to 1.4.3. So let's see if that actually work. So Jeremy, why are you using, like is Mamba not an option for this? Yeah, so this is, it's not a great option for installing stuff into a user directory. At least I'm less familiar with that. This is a way that I know is gonna work fine for this special situation where we wanna put stuff into our home directory. So yeah, Mamba and Condor are kind of synonyms. Mambas are faster way to do it, whereas PIP is a different thing altogether and it has this special thing I'm showing you right now, which is minus, minus user. And if Condor or Mamba has such a thing, I don't know about it and haven't learned how to use it yet. I'm not saying it doesn't exist, but at least for PIP, this works fine. So if we now look at fast cause version, there we go. So it has in fact installed 1.4.3. Now where did it put that? So here in our home directory, you can see it's actually created something called dot local and dot local is where PIP puts stuff that you install with dash, dash user. And as you can see, it's got various subdirectories and here is fast core. So if we wanna be able to continue to use the latest version of fast core next time, we start this notebook server. We want this dot local directory to still be there, right? Right? So how do we do that? Well, what we can do is we can actually put that into our storage. So we could move that into our storage. Now, okay, that's all very well, but we'll now be in storage next time we come back, but Python needs it to be here in our home directory. So what do we do? Well, what we have to do is we have to make it so that dot local in our home directory and dot local in our persistent storage are the same thing. And the way we do that is something with something Radick was mentioning before, which is using a sim link or a symbolic link. If I say LN for link and minus S for symbolic and I say, what's the thing that you wanna symbolically link? And I say it's slash George slash dot local. That's the thing I just moved. Then you'll find that in this directory, oops, hidden, there is now a dot local, but it looks special, looks different. And it's like saying, oh, it's not a folder at all. It's actually just pointing at this other place, but it's like it really exists. I can LS it, for example. I can CD into it. And remember to say the last token from the previous line, I said this before is exclamation mark dollar, so that'll be dot local. You can see it, that's CD dot local. So yeah, it's basically like a, it's not a copy of it. It's like a shortcut into it. In fact, I think on Mac, they're called aliases and on Windows, they're called shortcuts. It's the same thing, and on Unix type things, it's called a sim link or a symbolic link. So now if I run ipython again and check the version, yep, it's still 1.4.3. So it's still finding it. So this way we can actually make sure we've got, you know, that we can install and upgrade packages and still see them every time we launch, even if it's a new notebook server or relaunch an existing one or whatever. We just have to make sure that every time we start a new paper space instance that it creates these any sim links we want. And so paper space has this really nifty thing, which is you can create a file called dot bash dot local in storage and it will run that file every time you start a notebook. And so you'll see I've got a file there that goes through and creates a sim link to dot SSH and to dot local and to dot get credentials and a bunch of stuff that we haven't talked about all of them yet and dot Kaggle and sim links them all to slash storage. And so this way every time I start a new computer I'm gonna have all that stuff set up automatically, which is, yeah, I think is pretty, which is pretty great. So that's how you can customize your paper space instance. So Jeremy, just to recap there to make sure I've got that clear in my head and for everyone else too. So essentially what you've done is that you've got this bash script that you keep inside your persistent storage, which contains all your config and bits and pieces that you want. And then every time you fire up a new instance you just sim linking all that stuff you've got in storage to the machine you've just created. Yeah, and in particular, after I type pip install minus, minus user something it's created this dot local directory. So, and that's something that I want to be persistent. So I move that into storage and then sim link it back to where it's meant to be. Understood, thanks. And the reason that you're doing this is because you can't get access to the root directory on their server. Like, would you need to do this on your own computer? No, this is just for paper space. It's not that I can't access it, Mark, I can. I can install it, but the problem is these are not real servers. That's not persisted. So if I went in five hours time when this shuts itself down and then I start up the server again, it's not there. It's a mock server. It looks like it's your own server, but it doesn't actually keep your changes. So unless they're in this. This is necessary only on virtual machines, but like on your own computer, you wouldn't need to. This is not only just, this is like just this one. This is just paper space. Yeah, this is just for paper space. And we're spending time talking about paper space because it's so much better than any other option out there for GPU servers. Like they're the only ones that have these nifty tricks. Yeah, on your own computer, you don't have to worry about any of this stuff. And if you've got your own GPU, you certainly don't have to worry about it. But there are other notebook servers like Google Colab or whatever, but they don't have anything like this. So on Google Colab, you're gonna have to like reinstall everything you need every time you start up a new notebook and you won't have any of this proper environment. So yeah, as you might have seen, even my SSH keys. Sim-linked here. So I'm always gonna have my SSH keys any time I create a new paper space instance. So yeah, this is like a super convenient way to have a free GPU server whenever you want, which I think is pretty amazing. Jeremy, a question. I followed what you did in terms of installing, people installing the fast call, but then when I use Python and try to import fast call, it throws an error, but when I do, I Python and import fast call, it can find it, does it? That's interesting. Do you wanna share your screen and we could try to be back there? I might have to stop sharing first. Let's see. Okay, let's stop sharing. Should share now. Let me know. We're not seeing yet. Oh yeah, sorry. Here it comes. I forgot to press share again. No problem. Okay, so let's have a look. So this is on paper space and you went pip install, good. And you went, oh, interesting. Okay, so great. So press control D to exit from my Python and you can press it again or hit enter. You didn't actually have to press Y, see how it's in square brackets. That means it's a default. So you can just type. Okay, so let's find out what's going on. So type which Python, okay. So, and then type which IPython. I've got a strong suspicion. Try typing Python three instead of Python. So just type Python three or one word. Not which Python. Oh yeah. Sure. Okay, now try importing first core. Oh, interesting. Let's see if I have the same problem on mine. So Python import fast core. Oh, I'm getting the same error on mine. Very interesting. Okay, I'm gonna share my screen again. Very well spotted. So this is exactly the kind of bug that I want us to have so we can learn how to hopefully fix it. I wonder if, because I hardly ever just run Python and I've only recently started using PippinStore user because it's, because of this papers based thing. So I wonder if it's something specific to PippinStore user. So let's see if we can debug this. Actually, what's interesting is no module named fast core is actually very interesting because that means it also doesn't have fast AI, which yeah, okay. So the way Python finds modules is a very similar idea of how bash finds executables as there's a path basically. And so in Python, there's a module called sys which is where all kinds of things are stored. And so if we go sys. There's a sys.path. Now, this is not the bash path environment variable. This is a totally separate thing with a similar name which is an all lowercase path sys.path in Python. This is a list of places that Python will search for Python libraries. Now, if I import fast core, then you can see it's getting it from opt condolib Python 3.7 site packages. And you can see that is in my sys.path. So that's how it's finding fast core. So why isn't Python finding it? Well, we could do the same thing. sys.path. So that's interesting. So Python here is not including site packages whereas IPython is. So there's something I guess about how paperspace have installed things because I'm pretty sure that's not what happens here. Let's try it. Python import sys.path. Yeah, so here's site packages. So let's see what happens if we site packages. So this is like the normal place that pip and condo install things is into the site packages directory. And yeah, I've never really looked into it because I've never had problems accessing it before. Oh, it's something to do with Debian, puts things in disk packages. That's interesting. Site packages not in path. Jeremy? Why is this talking to me? Hang on a second. Sorry. Go on, yes, sorry. No, it's just when you were looking at those two paths, one was 3.7 and one was 3.9. I guess they were two different. Oh, I didn't even notice that. Is that true? You mean here? 3.9? Yeah. Oh, yeah, and 3.7. There you go. You're quite right. Thank you. Okay, so that'll be the reason. Which Python? Which IPython? Yes, okay. Yeah, all right. So it wasn't just a case for typing Python three, it was a case for typing Python 3.9. There we go. Oh, it's still not there. Oh, it's 3.7 that IPython is using. Python 3.7. Okay, thanks. That's exactly what it was. I don't know why they've got so many pythons installed. It seems a bit like overkill. So the Python, the 3.9 here was the system Python, right? And the Python 3.9 was the point. I mean, because we're on paper space, I think they were all which Python, which Python three, they're actually all the ones in Conda. So it's, so paper space is installed. Conda is the root. And so none of these are the system Python actually. Yeah, paper space is a bit unusual that they have us run as root. So things are a little bit confusing, actually. Yeah, now as to why IPython is running 3.7, I'm actually not sure. So something else that I do is I create a get directory and obviously, I create a get directory and then I get clone things into it using my SSH keys. And then what I do is I move the get directory into slash storage and then sim link it back. And actually where I sim link it to, I don't actually sim link it to my, home folder, actually sim link it inside slash notebooks. And the reason for that is that that's where that's where paper space uses as the root of its Jupiter lab. So actually you can see here I've done it before because it's in slash storage, right? So you can see, here's my, my get stuff. And so I actually think, you know, I don't really want any of this stuff that they've put in here for me. So actually maybe I should try deleting. In fact, let's try that. What happens if we create a server and we make that get repo thing empty? Because that's really what I want. You've uploaded your SSH keys into paper space. Yeah, I've uploaded them and I've put them in slash storage and in my dot slash storage slash dot bash RC dot local, I sim link them into my home directory. Correct. I'm not entirely paranoid about such things. Yeah. I mean, if you were, if you were paranoid about such things, then create a separate SSH key pair. Just for this and put that in your GitHub. So then people, if somebody steals your SSH private key, the worst thing they could do is to get into your GitHub. That's so cool. I didn't think about that. Wonderful. We did that. Thank you. All right. So what would happen? It's a bit overkill for. Notebooks at the moment. Let's delete some of these. So yeah, but for me on paper space, you know, everything's kind of going into that slash storage. So I don't really care about. Deleting things. All right. So if I, will it let me delete this? Cause that's really what I want to do. So I press delete. It's still showing me this. I don't know if that's a default or if it's just an example. Well, I'm here. So I just want to mention. Maybe. Sorry. Maybe I'm the only one. I understand it in principle, what you're talking about with the other. Ssh keys and importing them and everything, but the details of the execution. If I'm the only one that's fine, I'll struggle with it. Oh yeah. Let's, let's do that. I could actually do it. Yeah, let's do it. That's, that's excellent. Thank you. One thing I just want to do for my own interest is I'm just going to. Jump onto YouTube. And see if anybody actually watches these live streams. Cause if they don't. I won't waste my time running them. I don't know. Not sure it's worth it. Might just use zoom in the future. Did you know your hands up, right? By the way. Yeah. So. You don't have to put your hand up. You can just talk. Okay. Okay. Okay. You know, some libraries, the more exotic ones like, I'm not sure maybe graphs this or. I don't know. I don't know. I don't know. I don't know. I don't know. I don't know. I don't know. I don't know. You don't like it. I'm not sure maybe graphs this or. That they require. You use the something. Yeah. I'll do install. Some library. Yeah. Let's talk about that as well. Great. Okay. So this thing has. Successfully started. A new machine. Let's see if there's anything in it. So I was just starting the mission. When deleted the get repo thing. Yeah. Okay, great. So this is actually just empty. be more inclined to do, although I expected to see my slash kit there. Oh, wait. Okay. All right. Here's an interesting problem. That dot bash RC.local file, it runs when you run a terminal. So my git folder sim link didn't appear until I actually opened a terminal. As soon as I did that, it appears. And I probably hadn't noticed that before because I always run a terminal as soon as I start pretty much. There is a way actually that what they actually run when you start a notebook when you start a server is it actually runs this file run.sh, which we can't change. But it does actually have a pre run.sh file, which is if you put stuff in slash storage slash pre run.sh, it will run before Jupiter starts, which maybe is actually a better place for all the stuff I'm doing. Maybe that's what we should use instead of dot bash RC.local because this only runs when you run a terminal. Yes, interesting. Let's try that. Actually, I'd forgotten. It looks like I have got local member stuff working as well. Maybe we can try that next time. So by the way, to look at the the end of a file, you can just type tail. So if I go tail slash run.sh, there it is. So if I move dot bash RC dot, sorry, dot bash.local to pre dash run.sh. All right, let's try that. So if we now create a new notebook, if you're wondering why it is by the way that paper space is so perfectly set up for everything to work really well, it's because I've basically been nagging the perks of paper space for the last four years about all these things. And actually, it's just really in the last three months that they actually really started listening. And they've, I told them put this here, put this here, then it's going to be great. So they actually, yeah, they've been really great. Particularly recently. That's setting everything up exactly the way we need it. Okay. So delete that. And so I think, yeah, see, here's that command slash run.sh. So I guess what you could do by the way is you could like put some different like your own URL here, and it's going to like automatically put that in slash notebooks. And maybe you could even put a shell script then that comes from GitHub. I haven't really thought about that. Anyway, okay. So I think it was Mark that was asking, how would I actually get my dot SSH keys onto this machine? The short, I think the easy way to do it would be to use the upload file feature in JupyterLab. This is a really handy feature to know about. So you see this little button here, upload files. So you could click that. And then you could go into your dot SSH folder and find the files you want to upload and upload them. So for example, I do config. And you can see here it appears. And so then if I open my terminal, there it is there, right? And then you could just move that to where you need it. One tip with SSH keys actually, in fact, let's do it from scratch. Because that's what I meant to be doing. Let's do it from scratch to make sure everything works. So I'm going to RM dot SSH. Okay, so let's do it from scratch. SSH keys actually have to have very exact permissions on them. If they're if it's possible for anybody else to read or write your SSH keys, SSH will refuse to use them. And so one way to actually see the correct permissions is to create some SSH keys. So I could go SSH dash key gen enter, enter, enter. And then I can go LS minus LA dot SSH. And so to remind you, we just briefly see this the other day, the permissions. These three here tell you this user, which is root, can they read, write and execute the file. So this user, so the root can read, write and execute the this is the private key file. And it can also read, write and execute the public that's a read and write the public key file. These three here is what about everybody else. And this says everybody can read the public key file, but they can't do anything to the private key file. And then dot refers to the current directory. So the directory itself, only the root user can read, write and execute the directory. The idea of executing a directory might sound weird. It actually refers to seeing what is in a directory, they call executing a directory. So let's upload my keys. Okay, so there they are. Now they're going to be put into slash notebook slash git. So if I go CD dot SSH, and then I'll move slash notebooks slash git slash IDRSA. Now if I hit tab again, it'll show me that there's multiple things starting with those letters. If I say star, that refers to everything starting with those letters. So I'm going to move all of those things into the current directory. So the current directory remember is dot. So dot slash. And so there they now are. And now they don't have the right permissions anymore. My private key is readable by everybody, which is no good. So to change permissions, we say chmod change, I don't know why it's called mod, rather than chperm or something. And we can say that the group and the user should not have read permission. So the user and the group subtract read permissions on the private key. And then check again. Oh, I shouldn't have said user and group. What I meant to say, just remove permissions for myself to read it. I meant should have said group and everybody, which I think is all. So Jeremy, the dashes, the first three dashes are for user, the next three dashes are for the first dash is for directory or not directory, but the next three dashes Yeah, go on. The next three dashes are for user, user, the next three dashes are for group. And the last three dashes are for everyone. That's correct. Okay, that's what we want. So now the user can read and write the private key. And everybody, the user can read and write the public key and everybody can read the public key. So we can test this by SSHing to github.com. And github.com expects you to log in with the username git. So when you SSH before the at sign, you say the username to log in as, and by default, it uses your current username, just root. I definitely can't log in to github.com as root. github.com. Yes. Great. Hello, GPH. So it knows who I am, right? Because it knows who has my public key in that account. You've successfully authenticated. And then it closes it. Because you can't actually use a terminal on github.com. It's only used for forget, but you can see my key is working. And ask, wouldn't it be simpler? Or am I missing something to generate a new key in paper space rather than imported and then just give github that new key? Maybe. I don't know. I'm just thinking with all these, with all these like changing, with all these changing of permissions and stuff. I'm going to say like, okay, so I obviously I don't think so because I don't do it that way. But if I think about why I don't do it that way, like some people do it your way. Your way is in many ways more correct in that you would have different public keys on github.com for every machine you're using. And if somebody like stole a machine, you could delete just that public key. And that person now couldn't log in, but you could still log in. And maybe that's more convenient or something. It's a perfectly fine way to do it, Mark, honestly. I don't like the mental overhead of having to think about having multiple keys and which is which and because like, I've had a github account for quite a long time and probably used, I don't know, maybe 100 different machines to access it. And I don't like the idea of having 100 public keys and thinking where where are they and should they still be there? But yeah, I think it's fine. All right, so that was actually pretty intense today. So for folks who, you know, just getting started, there was nothing we use today. I don't think that we haven't learned how to use before. But it's tough using things that you've only just learned about. And so therefore, you know, it does need a lot of practice. So if you're kind of new to this, then yeah, then like, you probably want to rewatch the video and like, also, pepper me with questions next time, if you try things and and it doesn't work. For you're not sure why we do it or whatever. All right, anything else before we yep. Yeah, what about these things you have to install? Oh, yeah, between. Okay, let's do that next time. Yeah, let's do that next time. I will put it on the forum. Thanks. Oh, nice to see you all. So much. Bye. I think what? Thank you. Bye. Thank you. Bye.