back to index

Live coding 1


Chapters

0:0 Intros
3:26 Jeremy's way of doing stuff
4:48 What is a terminal/shell
6:7 Setup your mind
6:52 Guests expectations
14:7 How to use a terminal/shell
19:18 Installing python the right way
22:2 Clean your home directory
31:59 Using mamba/conda to install python libraries
40:52 How to make and run a shell script
57:5 Install other packages with mamba
62:4 Install pytorch
69:12 Install Jupyterlab
70:11 Create the first notebook

Whisper Transcript | Transcript Only Page

00:00:00.000 | Great.
00:00:08.000 | All right, so let's at least get introduction. So let's say hello. Hello.
00:00:15.000 | I guess probably people know me. I'm Jeremy, co-founder of Fast AI, and we're going to be doing a careful thorough
00:00:29.000 | and correct walkthrough of fast AI lessons and more generally how to data science, I guess.
00:00:39.000 | That's the plan.
00:00:42.000 | And we will see who ends up being regular guests with us, but at least we have have we have at least two regular guests, hopefully being Radac and Nick.
00:00:52.000 | So Radac and Nick, do you want to say hello and introduce yourselves?
00:00:59.000 | Sure. Nick, want to go first?
00:01:02.000 | Sure. I can go first, Radac, no worries. Hi, everyone. I'm Nick. I'm friends with Jeremy. I've been involved in machine learning and deep learning over the last, geez,
00:01:12.000 | longer than I care to think about, actually. But it's great to be here. And yeah, I'd love to help you out however I can. And I'm looking forward to getting into it. So nice to meet you all.
00:01:21.000 | And so, Nick, your background is mainly trading, I guess.
00:01:25.000 | Yeah. Yeah, mainly quant finance.
00:01:28.000 | And it'd be fair to say like you're extremely numerate, extremely good coder, but you haven't had as much experience with deep learning using Python.
00:01:39.000 | Like you seem to mainly, from what I've seen, you've used Wolfram quite a lot.
00:01:43.000 | Yeah, exactly.
00:01:45.000 | Technical background.
00:01:47.000 | Yeah, so I suppose I'm a one-trick pony in one sense in machine learning and deep learning in that it's usually been pretty heavily tabular data and financial data and some other bits and pieces along the way.
00:02:01.000 | Yeah, I've always coded in R and less so in Python.
00:02:06.000 | It's a transition for me, so I'm learning stuff along the way here too, and especially with coming to these frameworks like fast.ai, like I'm making my way around them just like the rest of you are, but it's fantastic to be here and I'm glad to be on the journey with all of you.
00:02:20.000 | Awesome.
00:02:22.000 | Hello, everyone.
00:02:24.000 | My name is Radek and super happy to be here.
00:02:28.000 | So, I guess I was trying to learn machine learning for quite a while. And then I did a fast.ai course, which was four years ago, and it's changed everything for me and I have been doing fast.ai courses ever since.
00:02:46.000 | Hoping to contribute in whatever way I can.
00:02:50.000 | And just because the home of global.ai is clearly in Queensland, Radek and Nick and I all happen to be in Queensland, within about an hour's drive of each other in fact.
00:03:04.000 | Absolutely, absolutely, and you know, AI can take you to interesting places, because if it weren't for AI, I wouldn't be able to be here.
00:03:15.000 | That's quite fun. You normally don't expect that to happen when you take an online course, but hey, fast.ai is the Nick in my mind.
00:03:26.000 | So, I thought we should start at step 0.1, which is making sure that we've got Python working.
00:03:38.000 | And not just working but working well.
00:03:42.000 | So, these sessions are not going to be about showing options for things, but showing you the one true way, by which I mean of course the way I do it.
00:03:56.000 | Having said that, I do actually try a lot of things. I am totally addicted to trying out software libraries and tools and configurations or whatever and I've been doing that for 25 years so I have actually more than 25 years.
00:04:17.000 | So yeah, you know, I find a lot of people on the forums.
00:04:23.000 | Watch a fast AI course and then go and have this conversation about like how to set something up. Nobody actually seems to just set it up the way I said just do it like this and when I say like no actually do it what I said.
00:04:34.000 | And then people are like, oh wow that doesn't actually work. So, before you get into complicated things you read about in the blog somewhere.
00:04:42.000 | Just do this, and you're going to see me do it from scratch. So you'll see it really does work.
00:04:50.000 | So one of the things we're going to be doing a lot is using a terminal, which a terminal looks like this, which is not the most exciting looking thing.
00:05:03.000 | You know, I started out, back in, you know, 30 years ago not using a terminal much at all.
00:05:13.000 | I was all kind of Excel, VB, whatever.
00:05:17.000 | And those are all very useful tools, but the terminal is great for data scientists because, rather than having to have a like a long list of click here, click next, minimize that, click there, drag here.
00:05:29.000 | You can put it in a little script and you just say run the script, you know, you can do things very quickly you can automate things it's like it's also like the difference between me speaking to you with with English language versus me holding up pictures and kind
00:05:43.000 | of diagrams or hand signals, you know, language is a really powerful way to communicate with the human and also with a machine.
00:05:54.000 | So there's a reason we're going to be using the terminal. A lot of the things we do, there will be gooey ways of doing it as well, but because this is the opinionated do it my way version.
00:06:05.000 | That's what we're going to be spending a lot of time on.
00:06:08.000 | And I want to like assume nothing, except that you like know how to use a computer and you know the basics of Python.
00:06:21.000 | That's hard for me because I've been using terminals and Python stuff for a long time. So I'm highly reliant on people asking questions.
00:06:32.000 | And I would certainly appreciate it if people ask questions here in zoom directly on audio, if possible.
00:06:41.000 | Otherwise, on YouTube live, don't use the zoom chat because it's a little bit harder for me to like zip in and out of.
00:06:53.000 | So yeah, before I get started anything particularly Nick and Radek that you were hoping to get out of these sessions or to share in these sessions I know Radek you were interested in learning a bit more about paper space, I believe.
00:07:08.000 | Yes, yes, that's true. I'm wondering where it fits in my stock as a data scientist.
00:07:16.000 | If it has a use. So I'm thinking about having something that I could access in my browser without thinking about starting an instance somewhere and essentially just add a click.
00:07:31.000 | This could be helpful, not even for doing the course but just something, something useful to have so definitely looking forward to learning about how we can use paper space.
00:07:43.000 | And of course Radek you're an AI expert in Nvidia so it's not like you have a shortage of GPUs you can access but they're not necessarily set up in as convenient a way as you described for just jumping into a browser and starting work right.
00:07:56.000 | That is true and I'm thinking, so I want to use tools in a way that speeds me up, you know, I want to create an environment where I feel comfortable, where I remove the tools from the equation and I can focus on doing the work.
00:08:14.000 | That not only includes work for, you know, like professional work but a big part of being a data scientist is continuing to grow your skills.
00:08:26.000 | So if I could be working on something and very often in data science, you know, you still have to wait for something to start or for some calculation to compete.
00:08:36.000 | And in those units of time where you know it's two minutes, three minutes, 10 minutes, I would jump into onto Reddit or you know would essentially waste my time and to my attention.
00:08:49.000 | If I would have a window in my browser a tab I could jump and do something useful something exciting like for example, submitting to a Kaggle competition or trying out a new library.
00:09:02.000 | I think that would be a really, really nice outcome. So, yeah, I'm curious if that's, that's something that paper space fast iteration speeds important for sure.
00:09:12.000 | By the way, I can hear you okay but you're a little quiet and I don't know if you've got a headset you can use your microphone you can move or volume control you can change or anything.
00:09:25.000 | How about you, Nick.
00:09:28.000 | Yeah, I would reflect what Reddick said, straight off the bat there that you want to just have as little friction as possible in your in your tool chain.
00:09:36.000 | And I think one of the great things about about doing these sessions is for people who, you know, it can be intimidating I think once you really start to get down into the tool chain when you go from perhaps having tried, you know, your first notebooks on Kaggle
00:09:48.000 | or you've been on CoLab or something else, you know, it can be intimidating to actually start getting down in the weeds of your system and getting to really know it and and some things can be so confusing it's like I should be using Tonda should be using member show.
00:10:00.000 | What's the right Python environment all these things. And, and it can be intimidating to find that out. So, like, not always great right.
00:10:07.000 | Exactly. And almost everyone is opinionated about how they want to use their tool chain for their thing but I think what I hope that everyone gets out of this is a way of is that there's a canonical fast AI way of doing things and and to be able to have a tool chain
00:10:25.000 | as as friction free as possible so that you can get productive with whatever task in your general compute environment. I think that's fantastic. And yeah, look forward to it.
00:10:36.000 | Anybody else listening or on YouTube live want to say what you're hoping to get out of this.
00:10:45.000 | Hello, everyone. My name is Ashley. Hi, Ashley.
00:10:49.000 | I'm a search on my video. Can you guys see me now. Sure can. Where are you joining from actually. I'm in Brisbane.
00:10:58.000 | You're working in Brisbane or student. Yes, I'm working as a graduate data scientist at Rio Tinto.
00:11:05.000 | And it's so happened that today I don't have any meetings so it's like, this is good.
00:11:11.000 | Yeah, and I can totally reflect on what Nick and Radik said about being as about having as little friction as possible because I'm like since I'm a graduate data scientist, I'm just starting my journey as a data scientist so trying to become a data scientist
00:11:28.000 | is what how I describe myself.
00:11:31.000 | And most of the times the problem that arises are just conflicts and libraries, and I want to do data science but I still end up doing that lots of that engineering stuff and realize which is good to realize that you're learning you're like learning
00:11:49.000 | what a data engineering role or that sort of thing what they do and help us in getting our environment set up, which is good to learn that they do a lot of stuff and I have huge respect for the data engineers at least at Rio now, but also learning that
00:12:05.000 | it's a good thing to, you know, what my interest like it was just data science and I would like to do that so that's something I'm looking forward to as well.
00:12:14.000 | Yeah, I mean there's a lot of stuff I think we need to really dig into over the coming weeks you know and it needs to include stuff like you know SQL and, you know, working with CSV files and all this stuff and it's good that all of you have talked
00:12:28.000 | about kind of decreasing the friction of data science because it's not just about doing it more quickly but if you have a lower friction, then it's less cognitive overhead for your brain and thinking about the process which means there's more room for your
00:12:41.000 | brain to think about solving the problem. Yeah, absolutely. Okay.
00:12:46.000 | Anybody else. Jeremy on.
00:12:50.000 | I'm just really enjoying the narrative.
00:12:54.000 | And also I'm hoping you'll be able to tune into the environment, but by the end of it so.
00:13:04.000 | Where are you joining from.
00:13:08.000 | A bit of a trial with paper space but I finally got that going after about what's this five weeks. And so anyway that set me back a bit but.
00:13:17.000 | So I'm really grateful that you're running these these additional issues. That's great. Could you quickly introduce yourself, who are you and where are you joining from me.
00:13:28.000 | I'm a QUT in Brisbane, and I'm a late entry PhD student spec coming to the end of that fact I saw you at the SDM. When you presented there.
00:13:43.000 | And it looks like your name is Daniel according to playing in the decomposition of heterogeneous data into a margin of sections and then using that for modeling of simulation.
00:13:58.000 | Oh, interesting. Okay.
00:14:00.000 | Great. Well, let's, let's, let's make a start then so I'm.
00:14:07.000 | Yeah, so please just dive in anytime.
00:14:10.000 | I do recommend if you're planning to join, you know, on a regular basis, the best thing to do is to get a headset with a boom, like I have here and like I see Nick has there and then you don't even have to worry about muting yourself, especially if it's a noise
00:14:26.000 | headphone because you can then just chat anytime.
00:14:32.000 | Yeah, and as I said just don't don't feel like you have to wait for the right moment just jump in and treat this like a conversation.
00:14:41.000 | Especially if I kind of like do something that you're like, what did Jeremy just do, or I talk about something as if everybody knows about it and you're like, I don't know what that is like, please ask.
00:14:53.000 | So let's start. So step one to working with the terminal is is running a terminal on your computer. So, I guess, you know, people here hopefully either have the Mac or Windows or Linux, if you have a Chromebook things are a bit difficult.
00:15:10.000 | And so I would suggest trying not to use a Chromebook. Right. If you're on a Mac to start your terminal just if you Google for Mac OS terminal Apple will tell you what to do.
00:15:21.000 | You can use command space type terminal you can click launchpad type terminal or in the finder.
00:15:29.000 | You'll see lots of conversations online about all the different terminals you can download and use as you'll see it really doesn't matter. Okay, so just use the one you've got.
00:15:38.000 | If you're on Linux, you probably already know how to use the terminal. If you're on Windows.
00:15:45.000 | Windows now has a terminal as well. So if you just go to Microsoft Store and type terminal, it'll download that for free.
00:15:53.000 | Okay, so what's a terminal terminal is strictly speaking, you know, it's a program looking like this that knows how to display a console window for a shell window.
00:16:09.000 | Now the thing inside it with a flashing cursor and these words and stuff is not strictly part of the terminal, right? That's something called a shell.
00:16:17.000 | So this thing called the Windows terminal can start a number of different shells. It can start a shell called PowerShell and so forth.
00:16:25.000 | So there's two different things. There's a thing called the shell. There's a thing called the terminal. We often use them a little bit interchangeably and that's fine.
00:16:33.000 | But the first time you start the Windows terminal, it's actually going to start something called PowerShell, which looks like this.
00:16:41.000 | So if you're running Windows, the next thing you need to do is type WSL install, which stands for Windows Subsystem for Linux.
00:16:51.000 | And nowadays in Windows, it's a single line. You just type WSL dash dash install and it says do that in administrator PowerShell. So if you type start PowerShell run as administrator, right?
00:17:06.000 | And then you can copy and paste that into the window and then reboot when it's done. And then you'll have actually an entire copy of a Linux distribution called Ubuntu running inside Windows.
00:17:17.000 | And that's what I recommend for Windows users.
00:17:20.000 | OK, so once you've done that, you should now find that you can go click here and go Ubuntu rather than PowerShell.
00:17:30.000 | And one of the things I like to do is to get all of my tools working so that they do what I want kind of automatically each time.
00:17:39.000 | So I don't use PowerShell very much. I mainly use Ubuntu as I expect you will be, especially for this course. So if you go into settings, you can choose the default profile as being Ubuntu.
00:17:52.000 | And then next time you open it, it will do Ubuntu by default. OK, so first time you run it, it'll ask you to choose a username and a password.
00:18:03.000 | That's because this is a whole separate operating system.
00:18:08.000 | So I've actually set up a new user.
00:18:21.000 | Totally empty. So I've got an empty. I'm going to start with a totally empty kind of virtual machine here. OK.
00:18:30.000 | And then, you know, the other thing I think is a good idea is to kind of give your terminal a full screen.
00:18:38.000 | So on Windows, for example, if you hit Windows tab, you have the ability to kind of move things around.
00:18:46.000 | And if you hit alt enter, you'll get a full screen. So now I've got lots of room for working with my terminal.
00:18:53.000 | So I'm not sure for whatever terminal you use on Linux or Mac, what the equivalent keyboard shortcuts are, but Google for keyboard shortcut Mac terminal full screen or something and virtual.
00:19:05.000 | These different these different like separate kind of virtual windows are called virtual desktops. Very good idea to learn to use virtual desktops.
00:19:15.000 | OK. So this is here we are in a terminal and we're going to we're going to set up Python. Now, the first thing to do in your terminal is to type Python and this is bad.
00:19:32.000 | I typed Python and something happened. I didn't want something to happen because we actually want to install our own version of Python.
00:19:40.000 | And so if you type something happens, that means you've already got a version and we definitely don't want to use it.
00:19:46.000 | And the reason for that is that the version that you're going to see by default is going to be what's called the system Python.
00:19:51.000 | It's the Python that your computer uses for like running stuff. We want to put in a separate version of Python.
00:19:58.000 | So when I type a command like Python, what it's actually doing is it's finding this somewhere on your hard drive and running that program and you actually want to know which one is it running.
00:20:10.000 | And so you can type which followed by the thing that you want to run Python and it's going to tell you this is running from something called slash user slash bin slash Python.
00:20:20.000 | Now, on the other hand, the user I created, which is called JPH 00, if I want to find out where I am right now, I can type print working directory.
00:20:32.000 | So there's this idea of like directories, which hopefully you're kind of somewhat familiar with from using like, you know, the finder or explorer or whatever.
00:20:46.000 | So on your computer, you know, there's some directory that you're in in finder or explorer and that you're seeing the contents of it and you can kind of move up and down and move around and there's kind of a concept of a current directory you're in.
00:21:02.000 | So in the terminal, it's exactly the same.
00:21:05.000 | There's a concept of what directory I'm in. And if I type PWD it tells you what directory you're in. So currently I'm in a directory called slash home slash JPH 00.
00:21:16.000 | So on all of the operating systems we're talking about today, I believe there's the same idea. Actually, I don't know if this is true on Mac. There's an idea of a home.
00:21:28.000 | Radec or, Nick, are you guys Mac users? If you go into terminal and type PWD, do you end up in some kind of home directory?
00:21:35.000 | Yeah, you do by default in Mac.
00:21:37.000 | Yeah. Okay. And that'll be like slash home slash Nick or whatever.
00:21:41.000 | Correct.
00:21:42.000 | Cool.
00:21:43.000 | Yeah, home slash user system username.
00:21:44.000 | Great. So all the same. Terrific.
00:21:49.000 | So generally speaking, we want to install everything into our home directory.
00:21:55.000 | We don't want to be using any versions of Python or anything that are in anywhere else such as this system directory. So let's go ahead and install our own version of Python we can use.
00:22:07.000 | And there is one and only one correct answer at the moment, in my opinion, to what should I install, which is to install some kind of anaconda distribution.
00:22:18.000 | So Python is an open source program. Lots of different people package it up for your computer.
00:22:25.000 | Which, which Python you install is going to make a huge difference to how easy everything is.
00:22:34.000 | Yeah, may ask a question, please.
00:22:37.000 | Yeah, are you using Windows 11 or Windows 10. I'm using Windows 11. I think they're almost exactly the same. I actually don't like it quite as much as Windows 10, to be honest, we're about to force everybody to upgrade anyways.
00:22:49.000 | I just bit the bullet.
00:22:55.000 | So tell me again what's the difference with the WSL install, I guess, on the 10 you have to specify WSL two.
00:23:05.000 | I would suggest a good reason for installing. Yeah, I do think that Windows 11 that the WSL story is a little easier. So that's probably one reason to upgrade.
00:23:15.000 | Also, if you do have a Nvidia GPU in your laptop like I do, it's much easier to use it in WSL.
00:23:25.000 | If you use Windows 11. Okay, so the particular distribution I strongly recommend using is called mini forge.
00:23:37.000 | Sorry, not actually we're not gonna use mini forge, we're gonna use mammer forge, mammer forge, I always get this confused, mammer forge.
00:23:47.000 | So let's go ahead and install it.
00:23:51.000 | So, if we scroll down, we'll find installers for mini forge, keep scrolling down, mini forge pipo 3 is clicked on here, mammer forge.
00:24:01.000 | Okay.
00:24:11.000 | Oops, so I'm going to try to remember to put stuff in here as we go.
00:24:20.000 | mammer forge installer.
00:24:28.000 | Save.
00:24:31.000 | All right.
00:24:40.000 | let's do everything through the terminal. I think it makes life easier. So not pipo 3 just mammer forge plain mammer forge.
00:24:46.000 | So we'll find. So I know I'm on Windows but I'm using WSL so that means I'm effectively on Linux, and I've got most computers AMD 64 unless you're on a Mac.
00:24:57.000 | So right click on this and I'm going to choose copy address.
00:25:02.000 | Okay, let's go back to our terminal.
00:25:04.000 | So in our terminal, you know, just like in find or explore it's good to keep things nicely organized so let's create a directory to put things we download into.
00:25:12.000 | So to create a directory, we type mukter make a directory, and then we'll call it downloads.
00:25:19.000 | So if I now list the directory that shows me or LS shows me all of the things that are in this directory. And so I've now got something called downloads.
00:25:29.000 | So to make that the current directory I change directory CD into it. Now, typing downloads takes far too long.
00:25:38.000 | So instead I'll just type the first couple of letters and then hit the tab key on my keyboard, and it fills it out for me.
00:25:45.000 | So the tab key is very helpful key to use in in your shell in your terminal.
00:25:52.000 | So we need somewhere in the terminal of downloading a file, and the main one I recommend using is called w get.
00:26:02.000 | So W get gets a URL and make sure you know how to paste things into your terminal.
00:26:13.000 | So I'm trying to remember I think there's some things you can figure around with.
00:26:28.000 | Or maybe it's just a default. So in, I think maybe it's a default in in WSL in Windows terminal you hit Ctrl shift V to paste. So there's the thing that I just copied URL.
00:26:40.000 | So if I hit enter now.
00:26:43.000 | It's going to go ahead and download that for me.
00:26:47.000 | There we go. Okay. Now,
00:26:51.000 | with data science, you spend a lot of time waiting for things.
00:26:57.000 | And so don't spend time waiting for things like downloads do something else at the same time.
00:27:03.000 | So you'll see here there's a little plus sign that lets me create another window, or I can use control shift one now I strongly recommend using keyboard shortcuts, wherever possible.
00:27:15.000 | So if I hit control shift one. I've now got a second terminal running and I can control tab between them. And so now we can keep doing things where that's happening.
00:27:30.000 | It's going to switch to my fresh new user. Okay, so,
00:27:37.000 | so while that's happening, let's talk about if you've tried to install Python before and you've got a million different versions of things that can get really confusing.
00:27:47.000 | I strongly recommend trying to clear everything away and starting from scratch. So the first thing is if you're in your home directory.
00:27:54.000 | So if you see this little tilde here that means I'm in my home directory. So although my working directory is slash home slash JPH whoa on Linux and on Mac most shells, the shortcut for your home directory is just to call it to order.
00:28:08.000 | So if I CD into downloads change directory into downloads. It says you are now in tilde slash downloads says a shorthand way of saying slash homes as JPH 00 slash downloads. Okay, if you've got any other anaconda many condo many forge, whatever here right now.
00:28:28.000 | Delete it.
00:28:30.000 | And so let's say you've got a mini condo, for example. So to delete a directory and all of its contents. Well, first of all, you could just move it out of the way. If you're worried you might lose something important.
00:28:41.000 | So to move something you type MV for move, move any condor to call it like many conduct old say and that now is going to get out of the way it's not going to interfere with anything so either remove or move out of the way any existing installations.
00:28:59.000 | The other thing you want to make sure is you don't have any.
00:29:04.000 | We don't have voice. Sorry.
00:29:09.000 | We had interruption, I think.
00:29:12.000 | Oh, you lost me for a bit.
00:29:16.000 | Can you hear me now. Yes, it's working now. Okay, how long did you lose me for.
00:29:23.000 | Five seconds.
00:29:31.000 | Okay, so
00:29:37.000 | as well as making sure that you don't have any other copies of anaconda or many conduct or many forge lying around. You also want to make sure you don't have any copies of Jupiter installed or anything like that installed in your system Python.
00:29:50.000 | So if you type I Python, you want nothing to happen that this is what you want. Or if you type Jupiter.
00:29:58.000 | You want nothing to happen. Okay, if something is happening. Right, then try typing pip uninstall. For example, I Python and Jupiter.
00:30:11.000 | Like try to uninstall all the copies of this stuff. You don't want them in your system Python it's going to make things very very confusing.
00:30:19.000 | If you can't uninstall things no matter how hard you try, then find out where that is. So for example type which Jupiter, right, and if you've got it installed it'll tell you since slash user slash bin slash Jupiter or whatever, and delete it.
00:30:34.000 | So to delete things to delete a directory and all of its contents. This is obviously very dangerous to be careful, you don't delete something you don't want to RM for remove minus R means recursively so all folders and files underneath it.
00:30:48.000 | F for force so do this without asking many kind of old for example.
00:30:55.000 | And you could do something similar if you had a slash user slash bin slash Jupiter for example you could type RM slash user slash bin slash Jupiter, and that would get rid of it.
00:31:05.000 | So you wanted to be at a point where, yeah, you don't have I Python, you don't have Jupiter, and you've downloaded. You don't have any any kind of directories in your home directory, and you've downloaded member forage.
00:31:24.000 | Alright, any questions or comments. So far.
00:31:32.000 | If you're kind of trying to follow along and something weird happens feel free to let us know you're welcome to share a screen, you know, debugging will help you know me.
00:31:41.000 | Yeah, you can see me hopefully you can. I'm Rob I'm down in Hobart. Hi Robin Hobart. I love it. It's a great place. It's just got above 11 degrees outside.
00:31:54.000 | I'm going to play a royal tennis if you have been. Oh yeah, yeah I know the tennis club. Yeah, beautiful. Anyway, I work for the bureau meteorology.
00:32:03.000 | There's a bit of background but the other guy that did the clouds detective. Yeah, that's me. Yeah, yeah. Yeah, that was fun.
00:32:10.000 | I was a quick question. Would you mind talking a little bit about Conda versus mamba. Yeah, we're going to do that now so absolutely.
00:32:19.000 | I'm happy sorry please anytime jump in.
00:32:23.000 | Alright, so let's just get this installed first of all so we've got okay so we've learned that LS lists the directory that we're in right now, and LS minus L gives us like alpha long form gives you more information about each thing.
00:32:42.000 | And so long form.
00:32:44.000 | It tells me how big it is now that's quite hard to read so another really helpful these are called flags really helpful flag is minus L minus h h is for human readable 89 big.
00:32:57.000 | And when you pass multiple flags to a program like this you don't actually have to put them each with a dash you can just put them next to each other.
00:33:04.000 | So minus l h is the same as minus l minus h. So this is list long form human readable so we just downloaded an 89 megabyte file.
00:33:13.000 | And this is a dot sh file a dot sh file is a script. It's something that it's basically a shell script it's a list of shell commands like LS or CD or which that are listed in order one after another in a text file.
00:33:29.000 | So you can look at a text file by typing less.
00:33:34.000 | And then the name of the file to look at now I'm going to type capital M a I'm not going to type all this out because I'm lazy I just hit tab.
00:33:41.000 | And then I'll press enter.
00:33:43.000 | And so you can see this is what a script looks like anything starting with a hash sign is a comment so it doesn't do anything. And then everything else is literally the shells is going to go through each of these lines one at a time and run them in your terminal.
00:33:57.000 | And so this is the thing that installs Bamber Forge.
00:34:01.000 | So to run a script there's a few ways to do it.
00:34:05.000 | The best way to do it is to run it.
00:34:11.000 | Well there's a few ways to do it. I think the way they suggest in the docs is that you type bash space and then there's such explain what's happening here.
00:34:20.000 | I mentioned that inside the terminal the thing that's like printing out this information and listening to my commands and doing stuff like LS is not the terminal itself, but something called a shell.
00:34:31.000 | And a shell is just a program that somebody wrote to let me type commands and get answers and stuff like that.
00:34:39.000 | The shell that you bun to users by default is called bash and the shell that Linux most Linux is used by default is also called bash the shell that Mac uses by default is called zsh.
00:34:55.000 | They're so similar.
00:34:57.000 | My suggestion is just don't worry about it. Like you'll find basically almost everything. I think everything we see today if you use a Mac will work just as well with bash.
00:35:06.000 | Max also come with bash. So it's like a pretty safe thing to run scripts with. So if you type bash space and then that it says please run this shell script using this shell.
00:35:18.000 | So it's going to run this as a bash script. So if I press enter.
00:35:22.000 | OK so this is now running this program called Man of Man before Linux dot sh.
00:35:27.000 | So please review the license agreement. Of course.
00:35:31.000 | Do I accept the license terms. I've read them very carefully.
00:35:35.000 | OK. And it's going to get installed for you. So I'll just press enter and you'll see here it's going to install it into my home directory to something called member Forge.
00:35:46.000 | Away it goes. OK. So while that's happening let's describe what's going on here. So this is installing not just Python but a whole bunch of libraries. These are all the libraries that it's installing.
00:35:59.000 | OK so it's finished. That was quick. Do you want to this to initialize it. So the answer is yes we do. And what that means is each time in the future that we open our terminal.
00:36:10.000 | It's going to automatically set up our Python environment for us. So type yes.
00:36:17.000 | There we go. So as it says for changes to take effect close and reopen your shell. So let's go ahead and do that.
00:36:23.000 | Jeremy I have a quick question. Yeah. I'm using a Mac and I went through lesson three and I think you had covered something about installing some of the software of including and then getting to the notebook.
00:36:42.000 | I'm a bit confused. So you been to doesn't apply to Mac does it are everything described so far will work perfectly on that. Yes.
00:36:51.000 | But can should I be using the terminal directly. And I do see that. Yes I suggest doing everything exactly as I'm showing it.
00:37:00.000 | Although the Mac version of the install let's see OS X the Mac installer might be not a shell script. No it is a shell script. Yeah. So it looks like it should work. Yeah.
00:37:13.000 | I think I can confirm it is.
00:37:16.000 | Great. Great. Yeah. So that should all work fine. If it doesn't let us know.
00:37:22.000 | But yeah sure. All the steps should be identical. Great. Thanks.
00:37:28.000 | All right.
00:37:31.000 | Okay so I just closed and reopened my shell. So one way to do that is just to close your terminal and open the terminal again and my terminal now looks slightly differently.
00:37:40.000 | It looks good. It's got the word base before it. And this is the way we can tell that we are. We have our Python environment running we're inside it, if you like. So we're all set up to use Python.
00:37:53.000 | So if I now type which Python it doesn't say slash user slash bin slash Python anymore. It actually shows me I'm in my home directory. There's a man before its directory and there's a bin slash Python there.
00:38:06.000 | This is what we want. Okay. You know you've set this up correctly. If you type which Python and you get back an answer that's inside your home directory.
00:38:20.000 | There's a number of reasons for this but really a key one as I say is that the main alternative is that you'll be using your system Python that's the Python that your computer uses for like running stuff in your operating system and that's causes all kinds of confusion with
00:38:35.000 | between what your computer is trying to do and what you're trying to do.
00:38:39.000 | It's also super easy when you're using the one in your home directory because if anything ever goes wrong.
00:38:45.000 | Like just RM minus RF member forage and that deletes everything and this run it again and you're up and running and you want to get to a point where you can do that.
00:38:57.000 | Incredibly easily.
00:39:01.000 | So let me now describe. Okay, so what I'm now going to do is I'm going to I'm going to show you I'm going to start from scratch. Right. So currently I got that all set up there's my man before directory created so I'm going to go RM minus RF member forage.
00:39:17.000 | There we go. I'm going to go to downloads and I'm going to even remove the installer we downloaded.
00:39:25.000 | Okay.
00:39:29.000 | And I got to show you how we can do all the same steps, but using a script. Oh, and also let's delete the thing that it that it added. Remember, I said, Do you want to automatically initialize member forage when you start your terminal.
00:39:43.000 | Well, what it actually did was it edited a secret hidden file. Normally LS doesn't show you secret hidden files but if you add the minus a for all it does. And so you can see now there's a whole bunch of files that we didn't see before anything starting with a dot is by default hidden in the shell.
00:40:05.000 | And this one here called bash RC, which if you're using a Mac will be called dot zsh RC is a script where all the things in that are run automatically. Every time you run your terminal.
00:40:18.000 | So if we edit that script.
00:40:29.000 | You can see at the end of it, they've the installer is set up stuff to initialize condo. So I'm just going to delete all that so that we're really back to scratch. Okay, so if I now close and reopen my shell.
00:40:48.000 | You can see it no longer says base right so we've totally started again.
00:40:53.000 | So I don't like to do anything. I'm going to do more than a couple of times. I don't like to do manually. So I'd like to automate this whole thing. So, which I have. There's a repo called fast setup.
00:41:09.000 | Which Radek knows well because he's helped set up some of this, which contains all the things I use to like very rapidly set up everything on a on a new computer or a new server or whatever.
00:41:22.000 | And there's a thing here called setup Conda.
00:41:36.000 | And I just wanted to ask, can you hear me a little bit better now, I switched a different microphone. Oh, so much wonderful, wonderful. So, now that you can hear me if I could maybe make one tiny comment, please, please.
00:41:51.000 | So, with the comments like we've seen LS dash minus a or there was another one and the dash minus RF. The flags, they often have the same unique for different programs.
00:42:07.000 | They have mv minus R that's recursive.
00:42:15.000 | I don't think you actually need that for me, but, for example, with the LS, the minus h flag, you will see the cross a bunch of other comments that the minus h will be human readable.
00:42:28.000 | And it might sound a little bit overwhelming to see these flags that maybe don't seem to make that much meaning. But since you will be using them across many commands and then there's also a trick to very easy to list the flags for command.
00:42:45.000 | You know, it actually gets quite straightforward.
00:42:51.000 | Yeah, that's a great point.
00:42:54.000 | Many programs have a special flag minus minus help, which will list all the flags, for example.
00:43:03.000 | They can be a bit overwhelming because there's a lot of flags but that doesn't mean you have to know them all.
00:43:08.000 | I mentioned something else which is like, you know, we're covering a lot of stuff pretty quickly and so people who haven't used the terminal before, there's going to be a lot of new information here.
00:43:18.000 | Obviously, it's a good idea to watch the video afterwards, but something that would I think help a lot of people in the community would be if there are bits that you do read it once again afterwards because you want to learn that bit is if you write it down.
00:43:34.000 | Like just write down what, you know, this is what Jeremy said and here's a link to the thing he was talking about, chuck it into a blog post that would like help a lot of people, because, you know, watching a video is takes more time than grabbing the best of bits out of a
00:43:51.000 | out of a blog post so that would be something if you're interested in both giving back to the community and documenting it for yourself.
00:43:58.000 | That would be amazing. And I guess something we should probably talk about in more detail at some point is how to write a blog post.
00:44:10.000 | Sharing things like the blog post or tweets or on the forums. It has a lot of nice benefits. It's not only that you're helping others, but you're also remembering the stuff better or understanding the things better.
00:44:25.000 | And I think that's something in words, you know, I often find myself writing something out and I think I understand it, but it's only at the point of putting it in words that I identify gaps in my understanding.
00:44:39.000 | It's definitely great for remembering things.
00:44:42.000 | The fact that I still have a hard time believing that it is a real thing, but it is. You will write something and you will share it and then somebody else will read it and they will say, hmm, that's useful.
00:44:56.000 | This person maybe knows about what they're talking about and suddenly people will reach out to you asking you to collaborate or maybe even, you know,
00:45:10.000 | you might need to professional opportunities. So it's something that is very far away from what we normally imagine that is possible, but apparently it is a very real thing.
00:45:23.000 | Well, it happened to you for sure. And lots of people in our community. When I look at the most, the biggest contributors to our community.
00:45:32.000 | All of them started out without having a job in AI and pretty much all of them have jobs or research positions in AI now. So probably not a coincidence.
00:45:42.000 | Now this thing we're looking at right now is a Git repo in GitHub. We'll talk more about Git a lot, but for now it's enough to know that GitHub is a place that has lots and lots of coding libraries and coding tools that you can download, edit, play with, explore, and so forth.
00:46:01.000 | So this is a very, very, very useful tool to get extremely familiar with. In this case, we want just one file from it, which is the file called setup condor.sh, which is a list of steps necessary to install member forage on your computer.
00:46:18.000 | As you can see, it's just 28 lines. It's very short.
00:46:21.000 | So how do you download a single file from GitHub?
00:46:26.000 | The way, in my opinion, is just to click on the file, click on raw, because you see at the moment it's got all this stuff around it. We just want the file itself. Click on raw.
00:46:38.000 | And now there's just the script, right? And now if I click on the URL and copy it,
00:46:45.000 | I can now go back here, and who remembers what we type? wget is the way we download something. So if I type wget setup condor, then that's now created a file called setup condor on my computer.
00:47:01.000 | And if I want to look at it, remember we type less.
00:47:05.000 | And there we can see there's the file. So we want to run this script.
00:47:10.000 | And you can see a bash script, a shell is a little mini programming language. So it's got a case statement. So the case, I mean, we can look at what it's going to do, right?
00:47:18.000 | It's going to check the operating system type. If it's Darwin, that's a Mac. It's going to check what kind of CPU you have, and it will download the appropriate member forage for your environment.
00:47:29.000 | And then it's going to check what shell you're using, and then it's going to set up bash or zsh_fish is appropriate.
00:47:36.000 | So echo means printout, sort of printout downloading installer, it'll download it, cowl is just like wget, and it'll run that bash thing we just saw, and it'll initialize it.
00:47:47.000 | There's a handy flag for the member forage installer -b, which is something that causes it to not ask you to check the license and stuff like that, it all happens automatically.
00:47:56.000 | So if I now do exactly what I did before to run my script, I could type bash setup condor.sh, that would work.
00:48:03.000 | Another thing we can do is the very first file here, hash exclamation mark, blah, blah, blah, blah.
00:48:12.000 | This tells our computer how to run this script that says to run it with bash.
00:48:20.000 | So we actually don't need to say bash, then that we can just run it directly.
00:48:25.000 | So we could try doing that, setup bash condor.sh, with a dot slash, this means in the current directory.
00:48:33.000 | And that doesn't work. And the reason that doesn't work is because by default things you download from the internet, you can't just run.
00:48:41.000 | Your computer assumes that, you know, things are dangerous unless you specify otherwise. So we need to tell it that this is something where I want to give it permission to execute this as a script.
00:48:54.000 | So if I type ls -la, actually just ls -a would be fine. No, ls -l.
00:49:03.000 | Oh, here's a trick. I want to repeat the last command, but I want to change the a to an l. So just press up arrow to get back the last command. Backspace, make that an l.
00:49:15.000 | So this thing over here we skipped over before, this is what's called the permissions. This tells you what you're allowed to do with a file.
00:49:22.000 | An r says you're allowed to read it. A w says you're allowed to write to it. And this dash here, if that was an x, it means you're allowed to execute it.
00:49:31.000 | So to change the permissions of a file. So we want to say that the user is allowed to execute it. We use a program called chmod to type chmod and you say, OK, who do you want to change the permissions for?
00:49:44.000 | And I say this user, that's a w. What permissions do you want to change? I want to add the executable permission. So you say plus x.
00:49:52.000 | And then you type the name of the program that you want to change the permissions for. So press tab.
00:50:00.000 | And so now if I go ls -l, I'll press up arrow twice and then hit enter.
00:50:05.000 | There's that x we wanted.
00:50:08.000 | OK, so now I should be able to rerun dot slash set up Conda. So press up a few times to find that there it is and hit enter.
00:50:18.000 | And so that's all going to go ahead and download and set that up for us.
00:50:27.000 | OK, so while that's happening, does anybody that will take a minute or two, does anybody have any questions or comments up to this point?
00:50:38.000 | Hi Jeremy, I had a doubt which version of Python are we using right now? And in case of some other kind of experimentations, if we want to switch Python versions, do we have any recommendations on that?
00:50:52.000 | So this is just going to use whatever the default is. And generally speaking, the default will be the most recent release.
00:51:02.000 | So we can check which version it's going to be by looking at MambaForge and say which version.
00:51:17.000 | The latest installers have Python 3.9.
00:51:22.000 | So I just use whatever is like the default because that's going to be most likely what most other people are using.
00:51:30.000 | There is actually a Python 3.10 now, but the fact that they're making the default 3.9 suggests that folks are thinking that's probably the most reliable thing to use.
00:51:41.000 | So that's what I would also recommend using.
00:51:44.000 | That's a nice thing about MambaForge and I call that it allows you to create environments very easy. So if you just want to experiment with a different Python version or with some different sets of packages, then it's just one command in your terminal that you have to execute and you're transported to a new environment, which is very helpful.
00:52:11.000 | Yeah, although I would recommend not using different versions of Python if you can avoid it. Sometimes you need to because you need to check compatibility like a lot of workplaces use really old versions.
00:52:23.000 | There's actually if you look up Python EOL for end of life, there's a list of like when each version of Python became end of life, which means you shouldn't be using it anymore.
00:52:36.000 | So 3.6 is now officially ended security support. So if your workplace is using 3.6 or older, you should be strongly encouraging them to upgrade because it's insecure.
00:52:49.000 | And so currently 3.7 to 3.10 are all supported versions of Python. I do tend to avoid using the very most recent version for probably a year after it's released because I find it takes a while for everybody to get compatible.
00:53:07.000 | So 3.10 in particular introduced some nasty incompatibilities, which I try to make sure fast AI works with them with all the versions, as long as PyTorch does, but yeah, I'd say the penultimate versions are good one to choose.
00:53:22.000 | And that's the default.
00:53:24.000 | Okay, so look at that we just ran a single command and it downloaded and installed.
00:53:29.000 | Okay, I have run into an error, saying, may I share my screen if that's all right? Yes, of course.
00:53:37.000 | Absolutely. Do I need to do anything? Yeah, you might need to give me permission to share. So I'll stop sharing.
00:53:45.000 | And then.
00:53:50.000 | Okay, got it. Thank you. Okay, so I just have to stop. No worries.
00:53:54.000 | Great. This is great. Our first debugging session. Here we go. Yeah. So this is the error, I think.
00:54:01.000 | Expected environment not found at prefix aborting.
00:54:07.000 | Interesting. Okay, so, did you do the manual version first and then now you're doing the script version? That's right. But I removed the through RM and RF.
00:54:18.000 | Oh, I see the problem. Do you see how you've got base in brackets before your... Yes.
00:54:23.000 | Okay, that means you're, you're inside Conda right now. So you've removed it but then you didn't close and reopen your shell.
00:54:30.000 | Oh, I see. So let's start again so close your, close your shell.
00:54:35.000 | And then reopen it.
00:54:45.000 | Okay now so the next thing you'll see here is it's complaining. No search file or directory. Oh, that's something else. Never mind about that. Okay, great.
00:54:52.000 | So, oh, now, yeah, good. So, that's something that actually just did is she typed CD with nothing after it, and that put her in her home directory.
00:55:01.000 | So you've been to on wsl is a bit weird. Most things put you there by default this one doesn't.
00:55:07.000 | Okay, great. So that should run the setup quantify now. So I would do an IRA minus IRF member forge at this point.
00:55:14.000 | And then, yeah, and then dot slash set up hundred.sh and then, yeah, come back.
00:55:20.000 | That's it. Good. Nice. All right, then come back to us if that causes will do. All right. Thank you so much. My pleasure.
00:55:29.000 | And the Python versions we discussed before. It is very rare, but it happens that you might encounter some code on GitHub, you will want to use your project, and it will use, it will require some Python version, you know, that's much earlier from what you're using.
00:55:46.000 | And in the environment that will be using Jupyter notebook, there is actually a way to run a specific version of Python for a for a given notebook so okay should we add that to our list of things to talk about them that sounds useful.
00:56:05.000 | I put that here things to cover.
00:56:08.000 | Sure, running. I mean, it's, it's useful in the sense that you don't have to switch environments while you're working on something and usually that would be part of your workflow that you want to do something to your data.
00:56:23.000 | Right.
00:56:25.000 | Thanks for that. Great. Okay, so I have to close and read my terminal.
00:56:32.000 | Done. And so again we've got that base there. Okay.
00:56:36.000 | And we'll also double check with which Python.
00:56:39.000 | Okay.
00:56:42.000 | So, with Python installed.
00:56:46.000 | We can run Python scripts,
00:56:51.000 | which isn't that useful of itself unless I mean because we want to be able to like, you know, have some environment we can we can work in, particularly in particular we want Jupyter.
00:57:01.000 | So we can install.
00:57:04.000 | We can install stuff into our Python environment, but actually this Python environment it's more than just Python we can actually install just any program we like, in fact, into into here so basically what
00:57:21.000 | Mamba Forge and Conda and so forth do is they basically create a whole kind of directory of programs and libraries for you in your home directory so it's not just for setting up Python, but for installing literally any program you want.
00:57:41.000 | So you'll find often when you install something you don't just end up with a Python library but there's actually programs that you can run like Jupyter, for example.
00:57:52.000 | Jeremy just very quickly just as a quick interruption.
00:57:55.000 | I think maybe some people might find it helpful even even I find it helpful still try and understand what I guess what it disambiguates Mamba from Conda from using pip, why would you choose one over the other.
00:58:07.000 | So now, exactly. Okay, cool. Perfect. So, so how do you install software into your Python environment. Well, let's start just by talking about how do you install Python libraries into your Conda environment.
00:58:20.000 | And Nick just mentioned the three options you have which is Conda, pip, and Mamba you'll come across all of these three things.
00:58:28.000 | Let's just focus first of all on Conda and Mamba. So, Conda and Mamba are literally two ways of doing the same thing. And they are fully compatible with each other. Mamba is a faster version of Conda.
00:58:44.000 | So why would you use Conda.
00:58:46.000 | Basically, you wouldn't. But Mamba is very new. So the vast majority of documentation you'll find on the internet users Conda. Anytime you see something that says Conda blah, you can type Mamba blah, and generally speaking, that's going to happen much faster, at least if the blah is install.
00:59:09.000 | So, let's look at an example.
00:59:13.000 | If I want to, so a really helpful thing for playing around with Python at the command line is I Python that's interactive Python, which we'll play with now I don't have a Python doesn't exist.
00:59:26.000 | Right. Now when I try to run it, it says, Oh, did you mean some of these other things. This is, this is Ubuntu talking to me.
00:59:33.000 | I don't want. Make sure you never install any Python stuff through through brew on Mac or apt on Ubuntu or whatever.
00:59:43.000 | That's just for the system Python only use Conda Mamba or PIP. The vast majority of the time you're going to be using Mamba. So if I type Mamba.
00:59:53.000 | If I just type Mamba, then it tells me okay well what do you want to do.
00:59:58.000 | In fact, it even says Conda is a tool for blah blah blah so you can see Mamba and Conda really get mixed up right.
01:00:05.000 | These are things you can do most of the time after typing Mamba you're going to be typing install. So, Mamba install, what do you want to install, I Python.
01:00:16.000 | And so what that's going to do is go away and check its index to see if anybody has uploaded something called I Python.
01:00:27.000 | And if they have it's then going to see what are all of the things that I Python depends on.
01:00:32.000 | And so it's now going to check with me. It's going to say okay for in order to use I Python, you got to install all these other things as well.
01:00:38.000 | Is that okay. Let's say yeah, that's absolutely fine.
01:00:42.000 | So that goes ahead and downloads those things.
01:00:46.000 | And it's awesome. And now I can type by Python.
01:00:50.000 | And there we go. So this is a Python REPL, a REPL is a read eval print loop, I can type things.
01:01:02.000 | And it will tell me the answers. Okay.
01:01:07.000 | So this is like a good way for quickly experimenting with stuff in Python on the command line. I don't use it very much because I mainly use Jupyter. But, you know, sometimes you're really quick and dirty stuff can be helpful.
01:01:20.000 | If you've read Wes McKinney's fantastic pandas and so forth book, Python for Data Analysis, he does most things in I Python.
01:01:30.000 | To close I Python, you close it in the same way as the fastest way also to close a bash or zsh shell, which is to hold down Ctrl and press D.
01:01:40.000 | And that exits. Okay, so Ctrl D is a nice fast way of closing probably most programs at your terminal.
01:01:53.000 | Okay, so that's how you install stuff.
01:02:00.000 | So let's install PyTorch, shall we? So PyTorch install. PyTorch, probably get started I guess.
01:02:24.000 | There we are, start locally. All right, get the latest version.
01:02:30.000 | It's choosing Windows, but I'm actually not on Windows, like I'm not WSL is not considered Windows, it's considered Linux. So, Linux, Conda, Python.
01:02:44.000 | And then there's various platforms you can choose. So if you've got an NVIDIA GPU, which you probably don't, you would choose CUDA.
01:02:52.000 | And if you don't, you would choose CPU. I actually do have an NVIDIA GPU on my laptop, but just to keep things simple. I'm going to do this and you can see by default it says Conda install.
01:03:02.000 | So remember, it's going to be faster if I use Mamba install. So I'm going to copy everything except the Conda copy.
01:03:08.000 | And then over here I'll type Mamba and then Ctrl+Shift+V to paste and enter.
01:03:17.000 | There we go. Now, you'll see here it's going to install.
01:03:24.000 | It's going to install PyTorch, Torch Vision, which is the computer vision bit of PyTorch, Torch Audio, the audio bit of PyTorch, just for the CPU.
01:03:33.000 | And this minus C is important. This is called a channel, a PyTorch channel. When people upload stuff that you can install from Mamba,
01:03:45.000 | it can kind of be installed to the main default repository that people grab stuff from,
01:03:51.000 | which in the case of the Mamba Forge package we're using is called Conda Forge, or they can upload it to their own channel.
01:03:58.000 | So PyTorch and FastAI and NVIDIA, we all upload things to our own channel. So to get stuff from the PyTorch channel, you say minus C PyTorch.
01:04:07.000 | That says, please search in PyTorch's channel for this software.
01:04:15.000 | OK, so it's now downloading all the packages that we asked for and also decompressing them.
01:04:29.000 | And so this is basically a list of all of the stuff that it figured out was needed to install PyTorch.
01:04:42.000 | Jeremy, quick question. Let's say that I'm like I just come along and I type in Mamba install PyTorch or something similar,
01:04:52.000 | or even if I'm reading through a blog post or a tutorial and I accidentally type in pip install xyz.
01:04:58.000 | Have I created a cardinal scene for which there is no return?
01:05:03.000 | You mean if you've pip install something rather than Mamba installing the thing?
01:05:07.000 | Correct, yeah.
01:05:08.000 | Yeah. So if you pip install PyTorch, like that is an option here, pip.
01:05:18.000 | The thing is, though, that they've got some extra things here to make sure that you get the version you want.
01:05:24.000 | Right. Mambas, so for one thing, if you've got a graphics card, an NVIDIA graphics card, pip installing won't work unless you do a lot of futzing around with installing NVIDIA's CUDA software development kit,
01:05:41.000 | which you don't want to do that. It's annoying, right?
01:05:44.000 | If you use Condor or Mamba to install it, it installs those libraries automatically for you.
01:05:51.000 | Even if you're using Windows, your NVIDIA GPU will still work.
01:05:57.000 | So, yeah, in general, installing with Condor or Mamba is going to more reliably give you the kind of correct setup of everything without you futzing around.
01:06:07.000 | Because Condor and Mamba are able to install what's called binary dependencies, so it installs all the libraries you need.
01:06:13.000 | If you've accidentally pip installed something, you can just type pip uninstall, the same thing.
01:06:20.000 | Problem is, though, that pip's going to have installed also a bunch of dependencies.
01:06:25.000 | Again, they came from pip rather than Mamba, and again, they might not be the right versions that are optimized for your machine.
01:06:30.000 | So, yeah, you know, I would be inclined to delete my Mamba Forge directory and start again, particularly if I did that for PyTorch, because it's just really important to have a good PyTorch installation.
01:06:46.000 | So that would be certainly my recommendation. I feel a bit the same way when we do Jupyter.
01:06:51.000 | If you accidentally pip install Jupyter, you know, I'd just be inclined to start again.
01:06:56.000 | But if you always type Mamba or Condor instead of pip, just make that your habit, then you won't get out of that situation.
01:07:06.000 | That's helpful.
01:07:08.000 | Yeah, I mean.
01:07:10.000 | Can you hear me?
01:07:12.000 | So, for certain things I believe was Tim, there is no way to install it with Condor.
01:07:20.000 | I didn't see it.
01:07:22.000 | There is, we will get to that, don't worry. But for now, my channel for fastchan will let you do that.
01:07:31.000 | Can I just type in or just make a comment?
01:07:36.000 | With pip, now, if I understand correctly, I think like if you just do pip, when you like set up a con environment, that pip is still going to be, I think, for like the system, right?
01:07:46.000 | No, no, no, it's not. It'll be fine.
01:07:50.000 | In fact, let's check, shall we?
01:08:00.000 | Alright, so which pip?
01:08:03.000 | No, we're all good. So it should be a problem.
01:08:06.000 | No, but like if you were to create a new environment, right, then, because right now you're from the base, right? So if you create your own environment.
01:08:15.000 | Well, we haven't got good environments yet, so I wouldn't worry too much.
01:08:18.000 | No worries.
01:08:22.000 | I mean, did you have a question or comment?
01:08:27.000 | It was the same as already discussed.
01:08:30.000 | Okay, so now that we've like installed this stuff, how do we know if it's working? So if I hit up arrow, I can find my ipython, and I could just try importing it.
01:08:44.000 | It is, right? So I can now type torch. and if I hit tab in ipython, it actually gives me a nice list of things.
01:08:52.000 | So for example, torch.tensor.
01:08:57.000 | And you can see it's going to give me the arguments.
01:09:03.000 | There we go. So that's working. So remember, control D.
01:09:08.000 | So yeah, another thing we probably want to install is Jupyter.
01:09:16.000 | So there's a couple of different versions of Jupyter. There's Jupyter lab, there's Jupyter notebook.
01:09:24.000 | So we'll probably use lab. Because we're using memberforge, this condorforge channel, we're going to be using automatically, right?
01:09:34.000 | So we don't need this -c condorforge. So we can just type member, install Jupyter lab.
01:09:47.000 | Okay, so that's got a lot of stuff. It's a big piece of software.
01:09:54.000 | But that's okay.
01:09:59.000 | Doesn't take too long. There we go. It's finished.
01:10:04.000 | Okay, so now we're ready to create our first notebook.
01:10:09.000 | So it's nice to keep things organized. So let's create a directory for our notebooks.
01:10:15.000 | So I'll make a directory called nbs and change directory to nbs. So that's empty. Okay. And so now we can type Jupyter lab.
01:10:29.000 | And there it is. Okay, so it got a little bit confused here in my version because WSL
01:10:39.000 | tried to open my browser. But my browser is a Windows application, not a Ubuntu application. So it tried to
01:10:47.000 | open it up and said there was an error. Now it's actually fine. I can still use this. So you can see here, if I click, if these are hyperlinks, I can
01:10:58.000 | control click on it.
01:11:02.000 | And it opens it up.
01:11:04.000 | There it is. Right. If I don't want it to complain like that, you can say don't open a browser by typing no dash browser.
01:11:21.000 | And that's it. Okay. And then click.
01:11:25.000 | Control click actually. Yes. Alan. Hello Alan. Hi everyone. I'm from Brisbane as well. I'm currently getting over COVID.
01:11:34.000 | How are you feeling?
01:11:36.000 | Apparently I'm loud out of isolation today. I don't feel that great yet.
01:11:41.000 | Sorry mate.
01:11:42.000 | Much better though. So that's fine.
01:11:44.000 | You know, the most important thing to know about for COVID is to take it easy on exercise until you're fully recovered because it's actually makes long COVID
01:11:52.000 | higher probability if you exercise when you've still got any symptoms. So take it easy.
01:11:58.000 | That's good. Well, I'm going to go for a walk later, just to the shops.
01:12:03.000 | A nice one.
01:12:05.000 | Just I was going to say with that JupyterLab and then no browser, this is one of the ones where I discovered the aliases were really my friend.
01:12:15.000 | I was about to show you that. Yes.
01:12:17.000 | Yeah, Alan.
01:12:18.000 | And why I got it. Yeah, so yeah, exactly. So I have.
01:12:35.000 | Let's see, what do I got here?
01:12:39.000 | I actually have even an alias for alias. So for things that are kind of long and annoying to type, you can create an alias.
01:12:56.000 | there's a few things we could do to not have to type JupyterLab no browser. One would be to hit up arrow.
01:13:02.000 | Now, one nice thing about up arrow is if I close my shell and go back into it, up arrow still works.
01:13:11.000 | And by the way, none of this stuff is magic, right? If you if you're wondering, why does that still work? It's because bash creates a file called dot bash history,
01:13:21.000 | which is actually really useful to know about because everything you've ever done is listed in that file.
01:13:26.000 | So here's all the things we do. This is another good reason to use the terminal is you can always go back and repeat things.
01:13:32.000 | This is actually how I create scripts. I do everything interactively. And then I copy and paste stuff from my bash history into a text file that creates a script.
01:13:42.000 | So if I hit up arrow, I can get my JupyterLab on a browser. A very, very, very helpful thing that works in Bash and ZSH is the control R keyboard shortcut. If I type control R, it says reverse search.
01:13:56.000 | And then I type JU for Jupyter. That will show me the last thing I type with those letters in.
01:14:02.000 | OK, and if that's not the right one, just hit control R again and it'll keep searching. So that's very useful.
01:14:10.000 | Jamie, is there any way to clean this is sort of clear. This is I assume that after a while it becomes such a long file.
01:14:19.000 | It's very difficult to make a script out of it.
01:14:21.000 | It's just it's just text. I think it automatically like cleans itself. But yeah, just leave it.
01:14:26.000 | You can always delete it if you want to or you can even edit it with an editor. But it's kind of nice to have all your history there, in my opinion.
01:14:35.000 | No, another thing you can do. Sorry.
01:14:38.000 | I think by default it's source 1009 or something like that, but you can set it to something more.
01:14:44.000 | Yeah, that's right. I think there's some environment variables.
01:14:48.000 | And then one other one, which is kind of interesting is exclamation mark followed by some letters runs the last thing that starts with those letters exclamation mark JU will run Jupyter lab no browser.
01:15:00.000 | Something that you'll see quite often is exclamation mark exclamation mark and that means just rerun the last command.
01:15:09.000 | As you see.
01:15:11.000 | And you can put that anywhere, by the way.
01:15:13.000 | So for example, if I type echo dollar dollar that filtered out as echo Jupyter lab no browser.
01:15:20.000 | So there's a little trick for you as well.
01:15:24.000 | OK, so Alan mentioned aliases. I could type alias Jupyter lab JL equals.
01:15:36.000 | And then I could put.
01:15:39.000 | This is going to work. Let's try it.
01:15:43.000 | Yep. Okay, so alias JL equals echo Jupyter lab.
01:15:48.000 | I don't want the echo there. Never mind. So let's just delete it.
01:15:54.000 | Oh, okay.
01:15:57.000 | When I am editing this line, there's a few shortcut keys to know about to go to the end of a line type control e.
01:16:06.000 | To go to the start of a line type control a.
01:16:10.000 | And then to go forward and backward by a word at a time, press alt left and right, which radical Nick is that option left and right on a Mac.
01:16:21.000 | To move by a word.
01:16:24.000 | I had it for a month, but couldn't get used to it.
01:16:29.000 | Nick, are you on a Mac? I'm using one as we speak right now, because it's better for running zoom on that. Yeah, you can do things like that.
01:16:36.000 | Although I'm used to all the Emacs key bindings, but that's a rabbit hole. I won't subject people to it.
01:16:43.000 | So now I've got this alias. I can just type JL.
01:16:48.000 | And it does the same thing. Now, the problem is that's not going to appear automatically next time I run my terminal.
01:16:56.000 | But remember, I told you about that special hidden thing called dot bash I see that automatically runs. So if we put it in there.
01:17:10.000 | Then it will automatically run.
01:17:12.000 | So if I close my terminal and reopen it.
01:17:19.000 | There's JL. Beautiful. Now you'll notice that when I edit files in the terminal, I tend to use a program called VIM, which as Nick well knows is obviously much better than the competition called Emacs.
01:17:33.000 | But you don't have to use either of these. You can use whatever you like.
01:17:37.000 | And in fact, on a Mac, if you type open that open dot, it'll open the finder at this directory or on Windows type explorer dot xe dot.
01:17:54.000 | Right. Oh, why doesn't that working? That's weird.
01:17:58.000 | Okay, that's never happened before.
01:18:03.000 | All right. So, amazing.
01:18:11.000 | Must be some recent change to WSL, which I will have to look into find out why explorer dot x is not working.
01:18:20.000 | I think you made a typo in the spelling explorer.
01:18:24.000 | What did I do wrong?
01:18:26.000 | I think you typed it.
01:18:28.000 | Okay, you added an extra period.
01:18:31.000 | The period at the end is intentional. That's to say open it in this directory.
01:18:38.000 | And I tried to have complete and complete didn't work. So,
01:18:42.000 | is it because they've changed it to it to work on my end. No, it's not works like your user, maybe you need to go to other user. Yeah, I tried it and another user.
01:18:57.000 | I think.
01:19:01.000 | Nevermind.
01:19:03.000 | Come back to that another day. I wonder if like.
01:19:10.000 | Yeah, what was he changed something.
01:19:14.000 | It seems to work for me. Yeah, I don't know if there's never not worked before.
01:19:20.000 | Okay, we'll figure this out and we'll cover it in the next session.
01:19:26.000 | Okay.
01:19:33.000 | Yes, this is amazing.
01:19:36.000 | And one of the things I like particularly about it.
01:19:41.000 | WSL like was the expert that x dot trick I think that's super useful and super amazing. But another wonderful thing that WSL allows you to do is to run the Linux programs in Linux.
01:19:55.000 | That's true. For example, I for example,
01:20:00.000 | use password manager, I can't imagine anything without it. And it's a pass.
01:20:09.000 | That's the US, I can just started in WSL, and it pops up a window in my windows.
01:20:16.000 | So I don't have to go there in WSL is you can just access through WSL dot localhost. So if I change this to JPH 00 I can do it this way.
01:20:34.000 | And so here's my bash RC.
01:20:37.000 | And then I can edit it with whatever I want to.
01:20:42.000 | Visual Studio Code, for example.
01:20:46.000 | Alright, so
01:20:52.000 | okay.
01:20:54.000 | So let's take a quick look at Jupiter.
01:21:07.000 | CD and these.
01:21:10.000 | When I run Jupiter.
01:21:14.000 | My other window.
01:21:22.000 | jail.
01:21:24.000 | Okay, so I'll control click here.
01:21:29.000 | When I run Jupiter by default, it's going to, it's going to kind of be inside the nbs directory. So when it says here.
01:21:37.000 | There's nothing in here, like it kind of says slash it doesn't really mean slash it means wherever I wherever you launched me from. So this is the contents of the nbs directory.
01:21:46.000 | So I can now create a new notebook.
01:21:49.000 | Like so.
01:21:52.000 | And run a cell and save.
01:21:58.000 | Okay, by default, it's called untitled by pi and be so if I now. So that's now running here right so I can't like do stuff here because it's busy running Jupiter so I'll open up another tab.
01:22:09.000 | And I can LS.
01:22:11.000 | And so on Windows terminal is just control tab to switch between tabs and you can see there it is untitled by pi and be right and we can even take a look at it. It's just a normal text file.
01:22:21.000 | Right.
01:22:24.000 | Okay, so we have Jupiter working, and we can
01:22:30.000 | import torch.
01:22:38.000 | Please object Jupiter and I pi widgets. Okay, that's interesting. Torch.
01:22:44.000 | Tensor.
01:22:48.000 | Cool. Okay.
01:22:51.000 | So, I'm guessing we need to install IPI widgets so we're getting pretty good at this. Let's try it.
01:22:59.000 | Mamba install IPI widgets.
01:23:05.000 | Oh, this is needs to be reopened.
01:23:19.000 | Okay.
01:23:21.000 | I'm surprised that's not installed by default, but there you go.
01:23:27.000 | So close Jupiter.
01:23:29.000 | Three open it.
01:23:32.000 | Control click.
01:23:37.000 | Already had it open.
01:23:39.000 | And let's see if it now works okay.
01:23:42.000 | You didn't mean to say new.
01:23:49.000 | There we go. And let's see if it now works.
01:23:53.000 | Yep, it's not complaining anymore.
01:23:58.000 | Okay.
01:24:01.000 | You can see Jupiter lab you can kind of do like normal gooey kind of stuff so if I want to delete this I could either go into my terminal and click and type RM untitled one, or I could right click on this and choose to leave.
01:24:15.000 | This feels like a pretty good place to leave things does anybody have any questions or comments before we wrap up.
01:24:26.000 | the session, Jeremy, that was really helpful in setting up a very smooth as well.